This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sjpalt
Recipients sjpalt
Date 2016-12-04.14:35:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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
# >>> proxy.x
# 52011448
# >>> proxy.x
# 6160
# ...

class Foo:

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:45sjpaltsetrecipients: + sjpalt
2016-12-04 14:35:45sjpaltsetmessageid: <>
2016-12-04 14:35:45sjpaltlinkissue28866 messages
2016-12-04 14:35:45sjpaltcreate