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 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 <[email protected]>
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: <[email protected]>
2013-05-12 05:25:20ethan.furmanlinkissue17947 messages
2013-05-12 05:25:20ethan.furmancreate

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant