You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EnumTransformer throws the following error when using Python 3.11:
File/fn/lib/python3.11/enum.py:742, inEnumType.__contains__(cls, member)
735importwarnings736warnings.warn(
737"in 3.12 __contains__ will no longer raise TypeError, but will return True or\n"738"False depending on whether the value is a member or the value of a member",
739DeprecationWarning,
740stacklevel=2,
741 )
-->742raiseTypeError(
743"unsupported operand type(s) for 'in': '%s' and '%s'"% (
744type(member).__qualname__, cls.__class__.__qualname__))
745returnisinstance(member, cls) andmember._name_incls._member_map_TypeError: unsupportedoperand type(s) for'in': 'str'and'EnumType'
The reason is due to these two lines in the assert_type:
Describe the bug
EnumTransformer
throws the following error when using Python 3.11:The reason is due to these two lines in the
assert_type
:The following code returns
True
in python 3.12. But will throw anTypeError
in python 3.11 as described above.Expected behavior
EnumTransformer
shouldn't throw a TypeError when checking if a value is a member of an Enum.Additional context to reproduce
No response
Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: