mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Annotate werkzeug wrap_file() and FileWrapper (#2519)
* Add FileWrapper protocol to wsgiref.types * Annotate werkzeug's wrap_file and FileWrapper * Remove empty line at end of file * Fix _Readable protocols
This commit is contained in:
committed by
Jelle Zijlstra
parent
48fc8d6d82
commit
6d6894e1ef
@@ -36,3 +36,9 @@ class ErrorStream(Protocol):
|
||||
def flush(self) -> None: ...
|
||||
def write(self, s: str) -> None: ...
|
||||
def writelines(self, seq: List[str]) -> None: ...
|
||||
|
||||
class _Readable(Protocol):
|
||||
def read(self, size: int = ...) -> bytes: ...
|
||||
# Optional file wrapper in wsgi.file_wrapper
|
||||
class FileWrapper(Protocol):
|
||||
def __call__(self, file: _Readable, block_size: int = ...) -> Iterable[bytes]: ...
|
||||
|
||||
Reference in New Issue
Block a user