A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-May/125860.html below:

[Python-Dev] PEP-435 reference implementation

[Python-Dev] PEP-435 reference implementation [Python-Dev] PEP-435 reference implementationSteven D'Aprano steve at pearwood.info
Thu May 2 03:37:48 CEST 2013
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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4