mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Add context manager for contextvars.Token (3.14) (#13997)
This commit is contained in:
@@ -6,8 +6,6 @@ _asyncio.all_tasks
|
||||
_asyncio.future_add_to_awaited_by
|
||||
_asyncio.future_discard_from_awaited_by
|
||||
_compression
|
||||
_contextvars.Token.__enter__
|
||||
_contextvars.Token.__exit__
|
||||
_ctypes.POINTER
|
||||
_ctypes.byref
|
||||
_ctypes.pointer
|
||||
@@ -92,8 +90,6 @@ concurrent.futures.thread._worker
|
||||
configparser.__all__
|
||||
configparser.InvalidWriteError
|
||||
configparser.UnnamedSectionDisabledError
|
||||
contextvars.Token.__enter__
|
||||
contextvars.Token.__exit__
|
||||
ctypes.POINTER
|
||||
ctypes.byref
|
||||
ctypes.memoryview_at
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from collections.abc import Callable, Iterator, Mapping
|
||||
from types import GenericAlias
|
||||
from types import GenericAlias, TracebackType
|
||||
from typing import Any, ClassVar, Generic, TypeVar, final, overload
|
||||
from typing_extensions import ParamSpec, Self
|
||||
|
||||
@@ -35,6 +36,11 @@ class Token(Generic[_T]):
|
||||
MISSING: ClassVar[object]
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
def copy_context() -> Context: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user