mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-09 06:45:51 +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:
1 parent
48fc8d6d82
commit
6d6894e1ef
2 files changed
+20
-11
No files matched your search
@@ -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