[docs] [issue12067] Doc: remove errors about mixed-type comparisons.
Guido van Rossum
report at bugs.python.org
Sat Sep 6 19:17:58 CEST 2014
Guido van Rossum added the comment:
- 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).
----------
nosy: +gvanrossum
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12067>
_______________________________________
More information about the docs
mailing list