On 4 May 2013 07:42, "Nick Coghlan" <ncoghlan at gmail.com> wrote: > 2. We restore __getitem__ on EnumMetaclass *solely* for member lookup > by name (the "getmember" functionality above). This would leave > __call__ used for the reverse lookup (value to member and hence name) > and __getitem__ for the forward lookup (name to member and hence > value) (Note: given Ethan's comments about his current implementation, > I believe this actually fits nicely with the way > EnumMetaclass.__getattr__ is already implemented) This has the advantage of leaving one obvious way to do the 'reverse' lookup (namely __call__), rather than two redundant alternatives. Cheers, Phil -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130504/5911fcb6/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