So PEP 335 was rejected.
Then a series of related PEPs followed: PEP505, PEP531, PEP532, PEP535.
However, all what they are trying to achieve (which are several different things) would be possible to do with PEP 335:
- PEP 505 -
pymaybe
library could just make use of it - PEP 531 - would be unnecessary due to (1)
- PEP 532 - probably would not be able to do all of that, but would cover the main presented use case (this one looks very heavy in additional design)
- PEP 535 - would be covered by this if
1 < a < 1
was to make use of it.
PEP 335 from a design perspective seems a pretty solid solution:
- It seamlessly integrates into the way things are - from user’s perspective it doesn’t bring in anything completely new - just one unary and 2 binary operators that one implements in the same manner as others
- Doesn’t seem to have any backward compatibility issues
Rejection reasons. 2 Sources:
- [Python-Dev] PEP 335 officially rejected
- PEP 532 – A circuit breaking protocol and binary operators | peps.python.org
So I am not sure about performance, but from my experience, there are always new ways to optimise if very much needed.
I don’t think the fact that this is a non trivial extension can be refuted. Learning materials would need to be updated and a lot of work to unwrap all that was built on top of the status quo would need to be done.
The benefits are well known, but to me the biggest sell point is that it is extremely unlikely that any alternative is going to appear that addresses the underlying need.
And 20 years later the need is still here. (At least 3 threads on PEP505…)
And I doubt that any idea will look “attractive/simple/pythonic enough” given the underlying need is simply “overloading logical operators”.
Anything else in comparison will look like A Rube Goldberg machine.
And to me it seems that any further endeavours are destined to fail as they are “trying to fill a circular hole without using circular shapes”.
So my questions:
- If this decision was to be made at the very beginning of Python, would this be a good idea?
- Is there any chance for reconsideration?