On Wed, May 8, 2013 at 12:53 AM, Ethan Furman <et...@stoneleaf.us> wrote:
> On 05/07/2013 07:48 AM, Piotr Duda wrote:
>>
>>
>> What about adding simple syntax (I proposed this earlier, but no one
>> commented) that take care of assigning name and module, something
>> like:
>>
>> def name = expression
>>
>> which would be rough equivalent for:
>>
>> name = expression
>> name.__name__ = 'name'
>> name.__module__ = __name__
>
>
> How is that different from
>
> --> name = Enum('module.name', ... )

With the repetition, you're setting yourself up for bugs in future
maintenance when either the module name or the assigned name change.

I like Piotr's suggestion of simply assigning to __name__ and
__module__ after the fact, though - much simpler than my naming
context idea.

Cheers,
Nick.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to