[Python-Dev] PEP-435 reference implementation
Steven D'Aprano
steve at pearwood.info
Thu May 2 03:37:48 CEST 2013
More information about the Python-Dev mailing list
Thu May 2 03:37:48 CEST 2013
- Previous message: [Python-Dev] PEP-435 reference implementation
- Next message: [Python-Dev] PEP-435 reference implementation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 02/05/13 08:54, Nick Coghlan wrote: > If enums had an "as_dict" method that returned an ordered dictionary, you > could do: > > class MoreColors(Enum): > locals().update(Colors.as_dict()) Surely that is an implementation-specific piece of code? Writing to locals() is not guaranteed to work, and the documentation warns against it. http://docs.python.org/3/library/functions.html#locals -- Steven
- Previous message: [Python-Dev] PEP-435 reference implementation
- Next message: [Python-Dev] PEP-435 reference implementation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list