mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Document Annotated and modified get_type_hints (PEP 593) (#3731)
This commit is contained in:
@@ -74,6 +74,9 @@ ChainMap = TypeAlias(object)
|
||||
if sys.version_info >= (3, 7):
|
||||
OrderedDict = TypeAlias(object)
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
Annotated: _SpecialForm = ...
|
||||
|
||||
# Predefined type variables.
|
||||
AnyStr = TypeVar('AnyStr', str, bytes)
|
||||
|
||||
@@ -599,9 +602,15 @@ class Pattern(Generic[AnyStr]):
|
||||
|
||||
# Functions
|
||||
|
||||
def get_type_hints(
|
||||
obj: Callable[..., Any], globalns: Optional[Dict[str, Any]] = ..., localns: Optional[Dict[str, Any]] = ...,
|
||||
) -> Dict[str, Any]: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def get_type_hints(
|
||||
obj: Callable[..., Any], globalns: Optional[Dict[str, Any]] = ..., localns: Optional[Dict[str, Any]] = ...,
|
||||
include_extras: bool = ...
|
||||
) -> Dict[str, Any]: ...
|
||||
else:
|
||||
def get_type_hints(
|
||||
obj: Callable[..., Any], globalns: Optional[Dict[str, Any]] = ..., localns: Optional[Dict[str, Any]] = ...,
|
||||
) -> Dict[str, Any]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def get_origin(tp: Any) -> Optional[Any]: ...
|
||||
def get_args(tp: Any) -> Tuple[Any, ...]: ...
|
||||
|
||||
Reference in New Issue
Block a user