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 ethan.furman
Recipients andymaier, ethan.furman, ned.deily, terry.reedy
Date 2014-06-02.16:05:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I think something like the following, taken from, shoud do the trick for something to test against:

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

    class VA(metaclass=Meta):
        def ham(self):
            return 'eggs'

which should result in:

    VA_instance = VA()
    VA_instance.ham  # should be 'eggs'
    VA.ham           # should be 'spam'

Combining all that with the DynamicClassAttribute should make a fitting test.  Thanks, Andreas, for working on that.
Date User Action Args
2014-06-02 16:05:07ethan.furmansetrecipients: + ethan.furman, terry.reedy, ned.deily, andymaier
2014-06-02 16:05:07ethan.furmansetmessageid: <>
2014-06-02 16:05:07ethan.furmanlinkissue21561 messages
2014-06-02 16:05:06ethan.furmancreate