Message188975
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. |
|
Date |
User |
Action |
Args |
2013-05-12 05:25:21 | ethan.furman | set | recipients:
+ ethan.furman, gvanrossum, barry, ncoghlan, benjamin.peterson, ezio.melotti, alex, eli.bendersky, docs@python, python-dev, zach.ware |
2013-05-12 05:25:20 | ethan.furman | set | messageid: <1368336320.95.0.52763307146.issue17947@psf.upfronthosting.co.za> |
2013-05-12 05:25:20 | ethan.furman | link | issue17947 messages |
2013-05-12 05:25:20 | ethan.furman | create | |
|