On Fri, Apr 12, 2013 at 9:30 AM, Barry Warsaw <barry at python.org> wrote: > On Apr 12, 2013, at 09:03 AM, Michael Urman wrote: > >(For the latter behavior, would adding DupEnum.name2 = DupEnum.name1 after > >the class declaration work today?) > > Yes, but the repr/str of the alias will show the original value. > That satisfies my concern. This gives an author the means to provide two names for a single value, and a way to choose which one is canonical. It's easy to imagine some corner cases related to persisting those values and then retrieving them with a later enum definition that changes the canonical name, but if you store raw values or names it should be easy enough to work around such things. Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130412/77378e57/attachment.html>
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