Andrés Delfino <[email protected]> added the comment:
I can't really say if it the return of __members__ is an implementation detail
as there's no mention of that in the doc, but from reading the doc I think it's
reasonable to think this is allowed:
import enum
class Colors(enum.Enum):
RED = enum.auto()
BLUE = enum.auto()
Colors.__members__['GREEN'] = enum.auto()
And the traceback:
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
Colors.__members__['GREEN'] = enum.auto()
TypeError: 'mappingproxy' object does not support item assignment
is somewhat confusing, as the documentation says an "ordered dictionary" is to
be returned, and the traceback talks about a mapping proxy.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue33862>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com