Revert "Improve [Async]ContextDecorator type hinting (#13416)" (#13436)

This reverts commit 57d7c4334b.

The attempted fix loses all type overload information during type
inferencing, so postpone fixing the issue until we have a solution
which doesn't impose such a dramatic loss in functionality.

Reopens #13403
This commit is contained in:
Alyssa Coghlan
2025-02-13 20:49:51 -08:00
committed by GitHub
parent a410f251ee
commit 3f41b30535
2 changed files with 7 additions and 9 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ from re import Pattern
from typing import Any, Literal, TypeVar
from typing_extensions import ParamSpec
_C = TypeVar("_C", bound=Callable[..., Any])
_Func = TypeVar("_Func", bound=Callable[..., Any])
_T = TypeVar("_T")
_P = ParamSpec("_P")
@@ -64,7 +65,8 @@ def decorator(
caller: Callable[..., Any], _func: Callable[..., Any] | None = ...
) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ...
class ContextManager(_GeneratorContextManager[_T]): ...
class ContextManager(_GeneratorContextManager[_T]):
def __call__(self, func: _C) -> _C: ...
def contextmanager(func: Callable[_P, Iterator[_T]]) -> Callable[_P, ContextManager[_T]]: ...
def append(a: type, vancestors: list[type]) -> None: ...