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

[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard libraryGreg Ewing greg.ewing at canterbury.ac.nz
Fri Apr 26 03:10:07 CEST 2013
On 26/04/13 11:53, Ethan Furman wrote:
>
> --> from Color import * # doesn't work in a function, though :(
>
> Yeah, that would be nice. ;) A bit dangerous, though -- what if another module
> does the same thing, but its Color is different?

It needs to put foo.Color in sys.modules, where foo is the
name of the defining module. Then you do

    from foo.Color import *

The drawback being that you need to write the name of the
module into the import statement. It's disappointing that
the import syntax doesn't have a way of saying "this module".

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