Message54110
Logged In: YES
user_id=4771
What you report are not error messages generated by
integers, but part of a general internal mecanism.
The golden rule with all __xxx__ special methods is that
they should not be called directly. This is especially true
for binary methods like __add__ which have pretty complex
internal semantics. The expression x+y is not equivalent to
x.__add__(y): roughly, althought it first tries
x.__add__(y), it checks if this returned NotImplemented and
calls y.__radd__(x) if it did. But there are a number of
subtle rules and special cases.
All special methods are meant to be called by language
operators (e.g. x+y, `x`,...); for special usages like
reduce(), all operators are also available as built-in
functions either directly (e.g. repr) or in the module named
'operator' (e.g. operator.add).
Finally, unbound method objects like int.__add__ are not to
be used unless one is really aware of what is going on. |
|
Date |
User |
Action |
Args |
2007-08-23 16:08:02 | admin | link | issue906746 messages |
2007-08-23 16:08:02 | admin | create | |
|