mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
inspect: update for py310 (#5296)
This commit is contained in:
@@ -105,7 +105,18 @@ def indentsize(line: str) -> int: ...
|
||||
#
|
||||
# Introspecting callables with the Signature object
|
||||
#
|
||||
def signature(obj: Callable[..., Any], *, follow_wrapped: bool = ...) -> Signature: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def signature(
|
||||
obj: Callable[..., Any],
|
||||
*,
|
||||
follow_wrapped: bool = ...,
|
||||
globals: Optional[Mapping[str, Any]] = ...,
|
||||
locals: Optional[Mapping[str, Any]] = ...,
|
||||
eval_str: bool = ...,
|
||||
) -> Signature: ...
|
||||
|
||||
else:
|
||||
def signature(obj: Callable[..., Any], *, follow_wrapped: bool = ...) -> Signature: ...
|
||||
|
||||
class Signature:
|
||||
def __init__(self, parameters: Optional[Sequence[Parameter]] = ..., *, return_annotation: Any = ...) -> None: ...
|
||||
@@ -119,8 +130,29 @@ class Signature:
|
||||
def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ...
|
||||
def bind_partial(self, *args: Any, **kwargs: Any) -> BoundArguments: ...
|
||||
def replace(self, *, parameters: Optional[Sequence[Parameter]] = ..., return_annotation: Any = ...) -> Signature: ...
|
||||
@classmethod
|
||||
def from_callable(cls, obj: Callable[..., Any], *, follow_wrapped: bool = ...) -> Signature: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@classmethod
|
||||
def from_callable(
|
||||
cls,
|
||||
obj: Callable[..., Any],
|
||||
*,
|
||||
follow_wrapped: bool = ...,
|
||||
globals: Optional[Mapping[str, Any]] = ...,
|
||||
locals: Optional[Mapping[str, Any]] = ...,
|
||||
eval_str: bool = ...,
|
||||
) -> Signature: ...
|
||||
else:
|
||||
@classmethod
|
||||
def from_callable(cls, obj: Callable[..., Any], *, follow_wrapped: bool = ...) -> Signature: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def get_annotations(
|
||||
obj: Union[Callable[..., Any], Type[Any], ModuleType],
|
||||
*,
|
||||
globals: Optional[Mapping[str, Any]] = ...,
|
||||
locals: Optional[Mapping[str, Any]] = ...,
|
||||
eval_str: bool = ...,
|
||||
) -> Dict[str, Any]: ...
|
||||
|
||||
# The name is the same as the enum's name in CPython
|
||||
class _ParameterKind(enum.IntEnum):
|
||||
|
||||
Reference in New Issue
Block a user