Message226496
- This bug should discuss doc updates, not question the rules.
- The rules have evolved over time and the docs stayed behind.
- We should definitely update the 2.7 docs as well as the 3.4 and 3.5 (in development) docs. The 2.7 docs need to be different than the 3.x docs.
- The language reference manual should clearly state the rules so that implementers can use them as guidelines for implementation.
- There are several sets of relevant rules:
(a) How is each operator translated into a series of lookups and method calls, etc. It's similar to other binary operators except that the reverse for __lt__ is __gt__ instead of __rlt__, and there's an extra rule that if __ne__ doesn't exist we compute __eq__ and take the opposite.
(b) The default implementation (e.g. default == falls back to 'is', < raises TypeError).
(c) The rules for built-in types, especially numbers (if there are still special cases that aren't explained by the __xx__ methods on the various numeric types). |
|
Date |
User |
Action |
Args |
2014-09-06 17:17:58 | gvanrossum | set | recipients:
+ gvanrossum, rhettinger, terry.reedy, mark.dickinson, benjamin.peterson, ezio.melotti, steven.daprano, cvrebert, chris.jerdonek, docs@python, ethan.furman, martin.panter, mikehoy, andymaier |
2014-09-06 17:17:58 | gvanrossum | set | messageid: <1410023878.27.0.0816209916129.issue12067@psf.upfronthosting.co.za> |
2014-09-06 17:17:58 | gvanrossum | link | issue12067 messages |
2014-09-06 17:17:57 | gvanrossum | create | |
|