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,3 +1,4 @@
from _typeshed import Self
from random import Random
from thread import LockType
from typing import IO, Any, AnyStr, Iterable, Iterator, Text, overload
@@ -23,7 +24,7 @@ class _TemporaryFileWrapper(IO[str]):
name: Any
def __init__(self, file: IO[str], name: Any, delete: bool = ...) -> None: ...
def __del__(self) -> None: ...
def __enter__(self) -> _TemporaryFileWrapper: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, exc, value, tb) -> bool | None: ...
def __getattr__(self, name: unicode) -> Any: ...
def close(self) -> None: ...