mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
fix type.__or__ (#14813)
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
This commit is contained in:
+4
-2
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user