Message282344
I ran into a strange bug while experimenting with metaclasses that implement a custom mro() method. It only seems to occur in interactive mode, either returning completely unrelated values or causing a segfault. Python 2 appears unaffected. I have been able to reproduce this with the following code:
# $ python -i weird.py
# >>> proxy.x
# 52011448
# >>> proxy.x
# 6160
# ...
class Foo:
pass
class Meta(type):
def mro(cls):
return (cls, Foo, object)
def __setattr__(cls, name, value):
setattr(Foo, name, value)
proxy = Meta('FooProxy', (), {})
proxy.x = 300
proxy.x # don't omit
proxy.x = 0 |
|
Date |
User |
Action |
Args |
2016-12-04 14:35:45 | sjpalt | set | recipients:
+ sjpalt |
2016-12-04 14:35:45 | sjpalt | set | messageid: <1480862145.72.0.468660451957.issue28866@psf.upfronthosting.co.za> |
2016-12-04 14:35:45 | sjpalt | link | issue28866 messages |
2016-12-04 14:35:45 | sjpalt | create | |
|