Message 199920 - Python tracker (original) (raw)

Updated and renamed the DynamicClassAttribute tests, and discovered that classify_class_attrs is not handling instance portion correctly.

class Meta(type):
    def __getattr__(self, name):
        if name == 'ham':
            return 'spam'
        return super().__getattr__(name)

class VA(metaclass=Meta):
    @types.DynamicClassAttribute
    def ham(self):
        return 'eggs'

We should see both eggs and spam, but only eggs is showing up.