3 ms·
Python's an object-based, highly dynamic, systems language. It's got a big set of builtins, a relatively large standard library, and is based around iteration a
by MostAwesomeDude 15y ago
Python's an object-based, highly dynamic, systems language. It's got a big set of builtins, a relatively large standard library, and is based around iteration and composition. It's not what I would consider a "little" or "fp" language. Sure, you can write pure, referentially-transparent units in Python, but sometimes you have to write things that set! attributes, and that's just a part of life.
Overloading these operators on function objects really isn't the end of the world. It's not like these operators were being used for anything, and sometimes this kind of DSL-ish extension can be good. It's certainly more reasonable than the goto module, which uses horrid bytecode hax to get the job done.
If you want this in the language, write to the python-ideas mailing list, and then draft a PEP if you get any support. Good luck!
- sinope 15y agoPython is most certainly not a systems language and if you think a PEP for this would go anywhere, you clearly don't know the devs very well either. Guido would never, ever allow anything like this into Python. Not when he's been campaigning to get rid of itertools.