[issue23292] Enum doc suggestion

2015-01-26 Thread Mark Summerfield
Mark Summerfield added the comment: Nice answer Ethan (but I can't vote you up since stack overflow won't let me vote or even comment anymore). As for adding export_to(), it seems like a good idea. However, personally, I think the signature should be hoist_into(namespace, cls, *clses)

[issue23292] Enum doc suggestion

2015-01-25 Thread Mark Summerfield
Mark Summerfield added the comment: Since this is a bit controversial, I've tried marking it as 'rejected' with this comment. I've also added a very brief explanation and link back to here on my web site: http://www.qtrac.eu/pyenum.html -- resolution: - rejected

[issue23292] Enum doc suggestion

2015-01-25 Thread Mark Summerfield
Changes by Mark Summerfield m...@qtrac.eu: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23292 ___ ___ Python-bugs-list

[issue23292] Enum doc suggestion

2015-01-25 Thread Ethan Furman
Ethan Furman added the comment: Amusingly enough, I posted a question/answer to StackOverflow (http://stackoverflow.com/q/28130683/208880) and so far the only other respondent posted an answer with similar functionality to my own, and also recommended that such a method be added to the base

[issue23292] Enum doc suggestion

2015-01-24 Thread Eli Bendersky
Eli Bendersky added the comment: Georg, each library writer is entitled to do whatever she wants. Naturally, we can't prevent dumping contents of enums into the module namespaces, and yes, backwards compatibility makes sense for some modules. However, that's tangential to *encouraging* this

[issue23292] Enum doc suggestion

2015-01-24 Thread Georg Brandl
Georg Brandl added the comment: Likewise, I don't feel strongly that it *should* go in, but I wouldn't object to it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23292 ___

[issue23292] Enum doc suggestion

2015-01-24 Thread Eli Bendersky
Eli Bendersky added the comment: 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

[issue23292] Enum doc suggestion

2015-01-24 Thread Georg Brandl
Georg Brandl added the comment: I disagree. I assume that many new enums will be a replacement for module-level constants, but these still have to be available on the module. Keeping backward compatibility is not against the spirit of Python :) --

[issue23292] Enum doc suggestion

2015-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree with Eli. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23292 ___ ___

[issue23292] Enum doc suggestion

2015-01-23 Thread Ethan Furman
Ethan Furman added the comment: Currently the way to add an Enum's members to a module's namespace is: globals().update(MyEnumeration.__members__) but that seems quite ugly. Is there anywhere else that the user is required to use __xxx__ methods for common functionality? I think a new

[issue23292] Enum doc suggestion

2015-01-23 Thread Georg Brandl
Georg Brandl added the comment: Well, for such operations (namespace manipulation) __dict__ is also often used, so I wouldn't say it's too ugly. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23292

[issue23292] Enum doc suggestion

2015-01-21 Thread Mark Summerfield
Mark Summerfield added the comment: Georg said to assign this to Ethan Furman but I don't seem to have that facility. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23292 ___

[issue23292] Enum doc suggestion

2015-01-21 Thread Mark Summerfield
New submission from Mark Summerfield: I think it would be worth documenting globals().update(MyEnumeration.__members__) in the Interesting Examples section of the enum docs. I suspect that most people will find that importing enums is annoying because they'll get import A

[issue23292] Enum doc suggestion

2015-01-21 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- assignee: docs@python - ethan.furman nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23292 ___