mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Fix werkzeug.wrappers.BaseResponse.__init__ (#2232)
This additionally allows strings, bytearrays and string iterables to be
passed as the `response` argument of `BaseResponse` (and thus also
`Response`).
Strings and bytearrays are explicitly handled in `__init__` [1].
Strings are also featured on the Werkzeug front-page snippet (`'Hello
World!'`) [2].
[1]: d129d17066/werkzeug/wrappers.py (L861)
[2]: http://werkzeug.pocoo.org/
This commit is contained in:
committed by
Jelle Zijlstra
parent
15ad132393
commit
4b5a63d10f
2
third_party/2and3/werkzeug/wrappers.pyi
vendored
2
third_party/2and3/werkzeug/wrappers.pyi
vendored
@@ -84,7 +84,7 @@ class BaseResponse:
|
||||
status = ... # type: str
|
||||
direct_passthrough = ... # type: bool
|
||||
response = ... # type: Iterable[bytes]
|
||||
def __init__(self, response: Optional[Union[Iterable[bytes], bytes]] = ...,
|
||||
def __init__(self, response: Optional[Union[str, bytes, bytearray, Iterable[str], Iterable[bytes]]] = ...,
|
||||
status: Optional[Union[Text, int]] = ...,
|
||||
headers: Optional[Union[Headers,
|
||||
Mapping[Text, Text],
|
||||
|
||||
Reference in New Issue
Block a user