Stephen J. Turnbull writes:
> _nameToLevel = { member.name : member for member in LogLevel }
Urk, premature expostulation there (not sure how it happened, I know I
fixed that line before sending...). Just
_nameToLevel = LogLevel.__members__
is fine here (LogLevel is an IntEnum, __members__ is a name : member
view). In fact, often better in general: if there were aliases, that
would catch all of the names, while the comprehension only catches the
canonical names. Which is why I bother correcting myself.
Steve
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/54WR7BKMIWMJVINK4T3WIQU6D5EPRXGN/
Code of Conduct: http://python.org/psf/codeofconduct/