[Python-ideas] Syntax for easy binding __name__, __module__, __qualname__ to arbitrary objects

Ethan Furman ethan at stoneleaf.us
Wed May 15 01:24:36 CEST 2013


On 05/14/2013 04:19 PM, Steven D'Aprano wrote:
>
> For many purposes, we won't even care about the container. We'll do
> something like this:
>
> Directions = Enum("Directions", "UP DOWN LEFT RIGHT")
> globals().update(Directions.members())
>
> (have I got the name "members" right?)

Almost.  It's __members__.

--
~Ethan~


More information about the Python-ideas mailing list