Use PEP 570 syntax in stdlib (#11250)

This commit is contained in:
Shantanu
2024-03-09 14:50:16 -08:00
committed by GitHub
parent 63737acac6
commit 470a13ab09
139 changed files with 2412 additions and 2371 deletions

View File

@@ -40,7 +40,7 @@ error = BadZipfile
class LargeZipFile(Exception): ...
class _ZipStream(Protocol):
def read(self, __n: int) -> bytes: ...
def read(self, n: int, /) -> bytes: ...
# The following methods are optional:
# def seekable(self) -> bool: ...
# def tell(self) -> int: ...
@@ -48,8 +48,8 @@ class _ZipStream(Protocol):
# Stream shape as required by _EndRecData() and _EndRecData64().
class _SupportsReadSeekTell(Protocol):
def read(self, __n: int = ...) -> bytes: ...
def seek(self, __cookie: int, __whence: int) -> object: ...
def read(self, n: int = ..., /) -> bytes: ...
def seek(self, cookie: int, whence: int, /) -> object: ...
def tell(self) -> int: ...
class _ClosableZipStream(_ZipStream, Protocol):
@@ -92,7 +92,7 @@ class ZipExtFile(io.BufferedIOBase):
def seek(self, offset: int, whence: int = 0) -> int: ...
class _Writer(Protocol):
def write(self, __s: str) -> object: ...
def write(self, s: str, /) -> object: ...
class ZipFile:
filename: str | None