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 <1401725107.11.0.816751004187.issue21561@psf.upfronthosting.co.za>
In-reply-to
Content
I think something like the following, taken from http://bugs.python.org/issue19030#msg199920, 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):
        @types.DynamicClassAttribute
        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.
History
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: <1401725107.11.0.816751004187.issue21561@psf.upfronthosting.co.za>
2014-06-02 16:05:07ethan.furmanlinkissue21561 messages
2014-06-02 16:05:06ethan.furmancreate