Backport many Self-related changes to the Python-2 stdlib (#7128)

This commit is contained in:
Alex Waygood
2022-02-04 18:10:05 +00:00
committed by GitHub
parent 57b2bae031
commit 51cdd2c6be
19 changed files with 37 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
import io
from _typeshed import StrPath
from _typeshed import Self, StrPath
from types import TracebackType
from typing import IO, Any, Callable, Iterable, Pattern, Protocol, Sequence, Text, Union
@@ -46,7 +46,7 @@ class ZipFile:
NameToInfo: dict[Text, ZipInfo]
start_dir: int # undocumented
def __init__(self, file: StrPath | IO[bytes], mode: Text = ..., compression: int = ..., allowZip64: bool = ...) -> None: ...
def __enter__(self) -> ZipFile: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...