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/2010-November/105938.html below:

[Python-Dev] constant/enum type in stdlib

[Python-Dev] constant/enum type in stdlib [Python-Dev] constant/enum type in stdlibGreg Ewing greg.ewing at canterbury.ac.nz
Wed Nov 24 00:41:50 CET 2010
Isaac Morland wrote:
> In any case my 
> suggestion of a new keyword was not meant to be taken seriously.

I don't think it need be taken entirely as a joke, either.
All the proposed patterns for creating enums that I've seen
end up leaving something to be desired. They violate DRY
by requiring you to write the class name twice, or they
make you write the names of the values in quotes, or some
other minor ugliness.

While it may be possible to work around these things with
sufficient levels of metaclass hackery and black magic, at
some point one has to consider whether new syntax might
be the least worst option.

-- 
Greg
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