diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-28 14:46:28 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-28 14:46:28 +0300 |
commit | 86568a9d1590ec529af95a7e16fb889b09162ed9 (patch) | |
tree | dbad39b76dcca72fd5551a0f782f6ad2a2bcd199 /contrib/python/prompt-toolkit/py3/prompt_toolkit/eventloop | |
parent | e6eedf7496d3741c2226a52ac25b12851b331112 (diff) | |
download | ydb-86568a9d1590ec529af95a7e16fb889b09162ed9.tar.gz |
intermediate changes
ref:8cc96053e249b790770c75de97ccbea86351cff2
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/prompt_toolkit/eventloop')
-rw-r--r-- | contrib/python/prompt-toolkit/py3/prompt_toolkit/eventloop/dummy_contextvars.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/eventloop/dummy_contextvars.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/eventloop/dummy_contextvars.py index 2b20d69b42..3fcd260551 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/eventloop/dummy_contextvars.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/eventloop/dummy_contextvars.py @@ -4,18 +4,25 @@ Dummy contextvars implementation, to make prompt_toolkit work on Python 3.6. As long as there is only one application running at a time, we don't need the real contextvars. So, stuff like the telnet-server and so on requires 3.7. """ -from typing import Any, Callable, Generic, Optional, TypeVar +from typing import TYPE_CHECKING, Any, Callable, Generic, Optional, TypeVar + +if TYPE_CHECKING: + from typing_extensions import ParamSpec def copy_context() -> "Context": return Context() +if TYPE_CHECKING: + _P = ParamSpec("_P") _T = TypeVar("_T") class Context: - def run(self, callable: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: + def run( + self, callable: "Callable[_P, _T]", *args: "_P.args", **kwargs: "_P.kwargs" + ) -> _T: return callable(*args, **kwargs) def copy(self) -> "Context": |