Message9206
Python code and builtin functions don't have a
consistent view of new style objects when method
attributes are assigned:
class A(object):
def __repr__(self):
return 'abc'
a = A()
a.__repr__ = lambda:'123'
Result: repr(a) != a.__repr__()
The repr() function sees the original __repr__ method
but reading the __repr__ attribute returns the
assigned function. With classic objects both cases
use the assigned method.
|
|
Date |
User |
Action |
Args |
2007-08-23 13:59:10 | admin | link | issue515336 messages |
2007-08-23 13:59:10 | admin | create | |
|