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 eli.bendersky
Recipients barry, docs@python, eli.bendersky, ethan.furman, georg.brandl, mark
Date 2015-01-24.12:23:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422102213.55.0.7855149694.issue23292@psf.upfronthosting.co.za>
In-reply-to
Content
I'm not sure why the current situation is annoying?

Python explicitly does not pollute the enclosing namespace with an Enum's members. So when you:

import A

It's fairly natural that you have access to A.MyEnum and not its members, no? Some modules (like some stdlib modules) may choose to push the enum members up to the module's scope explicitly, but I wouldn't necessarily call it best practice. Namespacing is Pythonic, splashing contents of classes into enclosing namespaces isn't.

So I guess what I'm trying to say is that I don't see a reason to explicitly suggest something that is, in general, against the spirit of Python, in the documentation.

[P.S. Thanks for reporting, Mark, I love your books!]
History
Date User Action Args
2015-01-24 12:23:33eli.benderskysetrecipients: + eli.bendersky, barry, georg.brandl, mark, docs@python, ethan.furman
2015-01-24 12:23:33eli.benderskysetmessageid: <1422102213.55.0.7855149694.issue23292@psf.upfronthosting.co.za>
2015-01-24 12:23:33eli.benderskylinkissue23292 messages
2015-01-24 12:23:33eli.benderskycreate