mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Improve contextvars.Context not to use Any where possible (#6942)
This commit is contained in:
@@ -38,11 +38,11 @@ def copy_context() -> Context: ...
|
||||
class Context(Mapping[ContextVar[Any], Any]):
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def get(self, __key: ContextVar[Any]) -> Any | None: ...
|
||||
def get(self, __key: ContextVar[_T]) -> _T | None: ...
|
||||
@overload
|
||||
def get(self, __key: ContextVar[Any], __default: Any | None) -> Any: ...
|
||||
def get(self, __key: ContextVar[_T], __default: _D) -> _T | _D: ...
|
||||
def run(self, callable: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ...
|
||||
def copy(self) -> Context: ...
|
||||
def __getitem__(self, key: ContextVar[Any]) -> Any: ...
|
||||
def __getitem__(self, key: ContextVar[_T]) -> _T: ...
|
||||
def __iter__(self) -> Iterator[ContextVar[Any]]: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user