mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-12 21:21:43 +08:00
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union, overload
|
||||
from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, Optional, TypeVar, Union, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -35,6 +35,10 @@ def copy_context() -> Context: ...
|
||||
# a different value.
|
||||
class Context(Mapping[ContextVar[Any], Any]):
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def get(self, __key: ContextVar[Any]) -> Optional[Any]: ...
|
||||
@overload
|
||||
def get(self, __key: ContextVar[Any], __default: Optional[Any]) -> Any: ...
|
||||
def run(self, callable: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def copy(self) -> Context: ...
|
||||
def __getitem__(self, key: ContextVar[Any]) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user