Author ethan.furman
Recipients alex, barry, benjamin.peterson, docs@python, eli.bendersky, ethan.furman, ezio.melotti, gvanrossum, ncoghlan, python-dev, zach.ware
Date 2013-05-12.05:25:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1368336320.95.0.52763307146.issue17947@psf.upfronthosting.co.za>
In-reply-to
Content
Eli,

The original _StealthProperty checked to see if it was being called on instance or class, and if it was the class it invoked __getattr__ to attempt a lookup for an enum member.  Your version does not check, but, ironically, the exception raised is AttributeError, and so Python is calling __getattr__ anyway and so finds the virtual enum member.

While this is cool, and it works, I think it's much less mysterious, magical, and downright confusing to keep the original behavior and call __getattr__ from _StealthProperty.  On the other hand, it might make somebody think, and that's always good, so I'm happy to leave it your way.
History
Date User Action Args
2013-05-12 05:25:21ethan.furmansetrecipients: + ethan.furman, gvanrossum, barry, ncoghlan, benjamin.peterson, ezio.melotti, alex, eli.bendersky, docs@python, python-dev, zach.ware
2013-05-12 05:25:20ethan.furmansetmessageid: <1368336320.95.0.52763307146.issue17947@psf.upfronthosting.co.za>
2013-05-12 05:25:20ethan.furmanlinkissue17947 messages
2013-05-12 05:25:20ethan.furmancreate