New submission from Ronald Pandolfi <[email protected]>:
Enum members assigned values that are functions don't remember those members.
For example:
def my_func():
...
class Test(enum.Enum):
a=1
b=my_func
Test.__members__
Out[7]: mappingproxy({'a': <Test.a: 1>})
Test.b
Out[8]: <function __main__.my_func()>
Even though b doesn't show in __members__ it is still an attribute of the Enum.
----------
messages: 405218
nosy: ronpandolfi
priority: normal
severity: normal
status: open
title: Enum behavior when values are functions
versions: Python 3.10
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue45657>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com