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/2003-November/040081.html below:

[Python-Dev] other "magic strings" issues

[Python-Dev] other "magic strings" issues [Python-Dev] other "magic strings" issuesBarry Warsaw barry at python.org
Fri Nov 7 13:50:34 EST 2003
On Fri, 2003-11-07 at 13:15, Skip Montanaro wrote:
>     Barry> I would love it if what happened really was something like:
> 
>     >>> from socket import *
>     >>> print AF_UNIX
>     socket.AF_UNIX
>     >>> from errno import *
>     >>> print EEXIST
>     errno.EEXIST
> 
> http://manatee.mojam.com/~skip/python/ConstantMap.py
> 
> No metaclass wizardry needed.
> 
> i-didn't-even-know-i-owned-a-time-machine-ly y'rs,

Oh boo.  Metaclasses are so much fun though! :)

But the enum stuff does have some other advantages.  I'll try to clean
the code up (read: document it :) and post it somewhere.

-Barry



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