mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Update inspect for Python3.12 (#10398)
This commit is contained in:
@@ -128,8 +128,21 @@ if sys.version_info >= (3, 11):
|
||||
"walktree",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
__all__ += [
|
||||
"markcoroutinefunction",
|
||||
"AGEN_CLOSED",
|
||||
"AGEN_CREATED",
|
||||
"AGEN_RUNNING",
|
||||
"AGEN_SUSPENDED",
|
||||
"getasyncgenlocals",
|
||||
"getasyncgenstate",
|
||||
"BufferFlags",
|
||||
]
|
||||
|
||||
_P = ParamSpec("_P")
|
||||
_T = TypeVar("_T")
|
||||
_F = TypeVar("_F", bound=Callable[..., Any])
|
||||
_T_cont = TypeVar("_T_cont", contravariant=True)
|
||||
_V_cont = TypeVar("_V_cont", contravariant=True)
|
||||
|
||||
@@ -184,6 +197,9 @@ def isclass(object: object) -> TypeGuard[type[Any]]: ...
|
||||
def ismethod(object: object) -> TypeGuard[MethodType]: ...
|
||||
def isfunction(object: object) -> TypeGuard[FunctionType]: ...
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
def markcoroutinefunction(func: _F) -> _F: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@overload
|
||||
def isgeneratorfunction(obj: Callable[..., Generator[Any, Any, Any]]) -> bool: ...
|
||||
@@ -360,6 +376,17 @@ class _ParameterKind(enum.IntEnum):
|
||||
@property
|
||||
def description(self) -> str: ...
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
AGEN_CREATED: Literal["AGEN_CREATED"]
|
||||
AGEN_RUNNING: Literal["AGEN_RUNNING"]
|
||||
AGEN_SUSPENDED: Literal["AGEN_SUSPENDED"]
|
||||
AGEN_CLOSED: Literal["AGEN_CLOSED"]
|
||||
|
||||
def getasyncgenstate(
|
||||
agen: AsyncGenerator[Any, Any]
|
||||
) -> Literal["AGEN_CREATED", "AGEN_RUNNING", "AGEN_SUSPENDED", "AGEN_CLOSED"]: ...
|
||||
def getasyncgenlocals(agen: AsyncGeneratorType[Any, Any]) -> dict[str, Any]: ...
|
||||
|
||||
class Parameter:
|
||||
def __init__(self, name: str, kind: _ParameterKind, *, default: Any = ..., annotation: Any = ...) -> None: ...
|
||||
empty = _empty
|
||||
|
||||
@@ -53,14 +53,6 @@ importlib.resources.files
|
||||
importlib.util.module_for_loader
|
||||
importlib.util.set_loader
|
||||
importlib.util.set_package
|
||||
inspect.AGEN_CLOSED
|
||||
inspect.AGEN_CREATED
|
||||
inspect.AGEN_RUNNING
|
||||
inspect.AGEN_SUSPENDED
|
||||
inspect.__all__
|
||||
inspect.getasyncgenlocals
|
||||
inspect.getasyncgenstate
|
||||
inspect.markcoroutinefunction
|
||||
logging.Logger.getChildren
|
||||
logging.__all__
|
||||
logging.getHandlerByName
|
||||
|
||||
Reference in New Issue
Block a user