mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 03:41:28 +08:00
Use PEP 570 syntax in stdlib (#11250)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user