mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -22,12 +22,10 @@ from typing import (
|
||||
Mapping,
|
||||
NewType as NewType,
|
||||
NoReturn as NoReturn,
|
||||
Optional,
|
||||
Text as Text,
|
||||
Tuple,
|
||||
Type as Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
ValuesView,
|
||||
_Alias,
|
||||
overload as overload,
|
||||
@@ -74,14 +72,14 @@ OrderedDict = _Alias()
|
||||
|
||||
def get_type_hints(
|
||||
obj: Callable[..., Any],
|
||||
globalns: Optional[Dict[str, Any]] = ...,
|
||||
localns: Optional[Dict[str, Any]] = ...,
|
||||
globalns: Dict[str, Any] | None = ...,
|
||||
localns: Dict[str, Any] | None = ...,
|
||||
include_extras: bool = ...,
|
||||
) -> Dict[str, Any]: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def get_args(tp: Any) -> Tuple[Any, ...]: ...
|
||||
def get_origin(tp: Any) -> Optional[Any]: ...
|
||||
def get_origin(tp: Any) -> Any | None: ...
|
||||
|
||||
Annotated: _SpecialForm = ...
|
||||
_AnnotatedAlias: Any = ... # undocumented
|
||||
@@ -103,11 +101,11 @@ else:
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
class ParamSpec:
|
||||
__name__: str
|
||||
__bound__: Optional[Type[Any]]
|
||||
__bound__: Type[Any] | None
|
||||
__covariant__: bool
|
||||
__contravariant__: bool
|
||||
def __init__(
|
||||
self, name: str, *, bound: Union[None, Type[Any], str] = ..., contravariant: bool = ..., covariant: bool = ...
|
||||
self, name: str, *, bound: None | Type[Any] | str = ..., contravariant: bool = ..., covariant: bool = ...
|
||||
) -> None: ...
|
||||
@property
|
||||
def args(self) -> ParamSpecArgs: ...
|
||||
|
||||
Reference in New Issue
Block a user