Message9207
Logged In: YES
user_id=6380
I'm going to reject this bug as "won't fix". I specifically
put code in the new classes to create this behavior. It's
partly a
performance hack: many operations become much slower if they
have to
check the instance __dict__ first. But I also believe it's
poor
style to override a system operation on the instance rather
than on
the class. If you want to be able to override behavior per
instance,
use this:
class A(object):
def __repr__(self):
return self.repr()
def repr(self):
return 'abc'
a = A()
a.repr = lambda: '123'
assert repr(a) == a.__repr__() == '123'
|
|
Date |
User |
Action |
Args |
2007-08-23 13:59:10 | admin | link | issue515336 messages |
2007-08-23 13:59:10 | admin | create | |
|