Message60294
Logged In: YES
user_id=593130
Print-style 'debugging' output provided by Bengt Richter in
a follow-up in the c.l.p. thread "Issue with new-style
classes and operators" showed that 'a+1' worked because
of a __getattr__ call getting '__coerce__' (rather
than '__add__') and that 'b+1' did not trigger such a call.
So I presume the quoted parenthesized statement about
__coerce__ and 'new-style numeric API' was meant to
explain as least this part of the change in behavior.
However, it is still not clear to me, even after reading the
development (2.3a) version of the ref manual, why failure
to find '__add__' in 'the usual places' (to quote RefMan
3.3.2 __getattr__ entry) does not trigger a call to
__getattr__, nor why the initial attempt to find it did not
trigger __getattribute__. The sentence 'For objects x and y,
first x.__op__(y) is tried' (3.3.7) implies to me that there is
an attempt to find __op__ as an attribute of x. Unless I
missed something I should have found, a bit more
clarification might be usefully added. |
|
Date |
User |
Action |
Args |
2008-01-20 09:55:52 | admin | link | issue643841 messages |
2008-01-20 09:55:52 | admin | create | |
|