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/106049.html below:

[Python-Dev] constant/enum type in stdlib

[Python-Dev] constant/enum type in stdlibGlenn Linderman v+python at g.nevcal.com
Sat Nov 27 21:56:14 CET 2010
On 11/27/2010 2:51 AM, Nick Coghlan wrote:
> Not quite. I'm suggesting a factory function that works for any value,
> and derives the parent class from the type of the supplied value.

Nick, thanks for the much better implementation than I achieved; you 
seem to have the same goals as my implementation.  I learned a bit 
making mine, and more understanding yours to some degree.  What I still 
don't understand about your implementation, is that when adding one 
additional line to your file, it fails:

w = named_value("ABC", z )

Now I can understand why it might not be a good thing to make a named 
value of a named value (confusing, at least), but I was surprised, and 
still do not understand, that it failed reporting the __new__() takes 
exactly 3 arguments (2 given).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20101127/c8056d0e/attachment.html>
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