fix type.__or__ (#14813)

Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
This commit is contained in:
KotlinIsland
2025-10-01 20:02:16 +10:00
committed by GitHub
parent 565cd2dbab
commit fc1062ca29
+4 -2
View File
@@ -226,8 +226,10 @@ class type:
@classmethod
def __prepare__(metacls, name: str, bases: tuple[type, ...], /, **kwds: Any) -> MutableMapping[str, object]: ...
if sys.version_info >= (3, 10):
def __or__(self, value: Any, /) -> types.UnionType: ...
def __ror__(self, value: Any, /) -> types.UnionType: ...
# `int | str` produces an instance of `UnionType`, but `int | int` produces an instance of `type`,
# and `abc.ABC | abc.ABC` produces an instance of `abc.ABCMeta`.
def __or__(self: _typeshed.Self, value: Any, /) -> types.UnionType | _typeshed.Self: ...
def __ror__(self: _typeshed.Self, value: Any, /) -> types.UnionType | _typeshed.Self: ...
if sys.version_info >= (3, 12):
__type_params__: tuple[TypeVar | ParamSpec | TypeVarTuple, ...]
__annotations__: dict[str, AnnotationForm]