3 ms·
Here's the rejected PEP for operator overloading. https://www.python.org/dev/peps/pep-0335/ https://www.python.org/dev/peps/pep-0335/ and deferred PEP for ric
by adamjb 6y ago
Here's the rejected PEP for operator overloading.
https://www.python.org/dev/peps/pep-0335/ https://www.python.org/dev/peps/pep-0335/
and deferred PEP for rich comparison chaining specifically
https://www.python.org/dev/peps/pep-0535/ https://www.python.org/dev/peps/pep-0535/
The central issue is that `3<=a<=5` expands to `3<=a and a<=5`, and `and` coerces the variables to booleans in order to work.
- proverbialbunny 6y ago>and deferred PEP for rich comparison chaining specifically >https://www.python.org/dev/peps/pep-0535/ https://www.python.org/dev/peps/pep-0535/ Oh nice! Thank you for sharing. I'm sure the functionality will eventually come.
- roudaki 6y agoI have been doing math in python for a year and this explains so much. I feel so stupid now. Thank you for this from self thought dev.