File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -76,12 +76,12 @@ def __getitem__(cls: type[_S], name: str | int) -> _S | Array:
7676
7777 __len__ = MetaType .__len__
7878
79- if not PY_312 :
80- # Backport __contains__ from CPython 3.12
81- def __contains__ ( cls , value : Any ) -> bool :
82- if isinstance (value , cls ):
83- return True
84- return value in cls ._value2member_map_
79+ def __contains__ ( cls , value : Any ) -> bool :
80+ # We used to let stdlib enum handle `__containts``` but this commit is incompatible with our API:
81+ # https://github.com/python/cpython/commit/8a9aee71268c77867d3cc96d43cbbdcbe8c0e1e8
82+ if isinstance (value , cls ):
83+ return True
84+ return value in cls ._value2member_map_
8585
8686 def _read (cls , stream : BinaryIO , context : dict [str , Any ] | None = None ) -> Self :
8787 return cls (cls .type ._read (stream , context ))
You can’t perform that action at this time.
0 commit comments