On Wed, May 8, 2013 at 12:53 AM, Ethan Furman <ethan at 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.
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