Closed
Description
Bug report
Bug description:
On Python < 3.12 instantiation of an empty Enum
with any value resulted in ValueError
, but on 3.12.0rc2 it returns <enum 'bar'>
without errors. On 3.12.0rc1 it resulted in TypeError: 'NoneType' object is not iterable
that was addressed in this issue:
I'm not sure if it's intended or not but just in case, I'll write about it, so that if it's unintended behaviour it could be fixed before the final release. For me ValueError
was more consistent but I don't see a practical reason to use empty enums anyway and I'm fine if this issue is going to be closed.
class Foo(Enum):
pass
print(Foo('bar'))
# 3.11: ValueError: 'bar' is not a valid Foo
# 3.12.0rc1: TypeError: 'NoneType' object is not iterable
# 3.12.0rc2: <enum 'bar'>
CPython versions tested on:
3.12
Operating systems tested on:
macOS