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
Linked PRs
Bug report
Bug description:
On Python < 3.12 instantiation of an empty
Enumwith any value resulted inValueError, but on 3.12.0rc2 it returns<enum 'bar'>without errors. On 3.12.0rc1 it resulted inTypeError: 'NoneType' object is not iterablethat was addressed in this issue:NoneTypeobject is not iterable #106928I'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
ValueErrorwas 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.CPython versions tested on:
3.12
Operating systems tested on:
macOS
Linked PRs
names=()to create empty enum type #109048names=()to create empty enum type (GH-109048) #109122