Fixing stubtest issues (#5339)

* Fix stubtest issues
This commit is contained in:
hatal175
2021-05-05 17:23:43 +03:00
committed by GitHub
parent 8379386bd4
commit 461791db27
16 changed files with 96 additions and 97 deletions

View File

@@ -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: ...