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,4 +1,5 @@
import io
from _typeshed import Self
from types import TracebackType
from typing import IO, Callable, Iterable, Iterator, Mapping, Text
@@ -103,7 +104,7 @@ class TarFile(Iterable[TarInfo]):
errorlevel: int | None = ...,
copybufsize: int | None = ..., # undocumented
) -> None: ...
def __enter__(self) -> TarFile: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...