[Python-Dev] enum discussion: can someone please summarize open issues? (original) (raw)

Phil Connell pconnell at gmail.com
Sat May 4 11:26:41 CEST 2013


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>



More information about the Python-Dev mailing list