stdlib: Improve a bunch of __(a)exit__ methods (#7571)

This commit is contained in:
Alex Waygood
2022-04-01 07:05:25 +01:00
committed by GitHub
parent 85f060b26d
commit da3e69d093
20 changed files with 47 additions and 28 deletions

View File

@@ -1,6 +1,7 @@
import sys
from _typeshed import Self, StrOrBytesPath
from datetime import date, datetime, time
from types import TracebackType
from typing import Any, Callable, Generator, Iterable, Iterator, Protocol, TypeVar
from typing_extensions import Literal, final
@@ -183,7 +184,9 @@ class Connection:
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, __type: type | None, __value: BaseException | None, __traceback: Any | None) -> Literal[False]: ...
def __exit__(
self, __type: type[BaseException] | None, __value: BaseException | None, __traceback: TracebackType | None
) -> Literal[False]: ...
class Cursor(Iterator[Any]):
arraysize: Any