mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Fix TypeVar argument annotations (#6943)
Arguments like bound= accept type forms like unions, which are not themselves types.
This commit is contained in:
@@ -15,17 +15,12 @@ Any = object()
|
||||
|
||||
class TypeVar:
|
||||
__name__: str
|
||||
__bound__: Type[Any] | None
|
||||
__constraints__: Tuple[Type[Any], ...]
|
||||
__bound__: Any | None
|
||||
__constraints__: Tuple[Any, ...]
|
||||
__covariant__: bool
|
||||
__contravariant__: bool
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
*constraints: Type[Any],
|
||||
bound: None | Type[Any] | str = ...,
|
||||
covariant: bool = ...,
|
||||
contravariant: bool = ...,
|
||||
self, name: str, *constraints: Any, bound: Any | None = ..., covariant: bool = ..., contravariant: bool = ...
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def __or__(self, other: Any) -> _SpecialForm: ...
|
||||
@@ -75,12 +70,10 @@ if sys.version_info >= (3, 10):
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
class ParamSpec:
|
||||
__name__: str
|
||||
__bound__: Type[Any] | None
|
||||
__bound__: Any | None
|
||||
__covariant__: bool
|
||||
__contravariant__: bool
|
||||
def __init__(
|
||||
self, name: str, *, bound: None | Type[Any] | str = ..., contravariant: bool = ..., covariant: bool = ...
|
||||
) -> None: ...
|
||||
def __init__(self, name: str, *, bound: Any | None = ..., contravariant: bool = ..., covariant: bool = ...) -> None: ...
|
||||
@property
|
||||
def args(self) -> ParamSpecArgs: ...
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user