
April 22, 2020
4 p.m.
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