From c5bc3bd7fa532cd4b71af3a39e832891e068326e Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 11 Jun 2018 14:03:02 -0700 Subject: [PATCH] make contextvars.Context instantiable (#2119) Part of #1476. --- stdlib/3.7/contextvars.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/3.7/contextvars.pyi b/stdlib/3.7/contextvars.pyi index b5c8082aa..6fe499e34 100644 --- a/stdlib/3.7/contextvars.pyi +++ b/stdlib/3.7/contextvars.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, ClassVar, Generic, Mapping, TypeVar, Union +from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union _T = TypeVar('_T') @@ -25,3 +25,6 @@ class Context(Mapping[ContextVar[Any], Any]): def __init__(self) -> None: ... def run(self, callable: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... def copy(self) -> Context: ... + def __getitem__(self, key: ContextVar[Any]) -> Any: ... + def __iter__(self) -> Iterator[ContextVar[Any]]: ... + def __len___(self) -> int: ...