forked from orbit-oss/flask
fix annotation for json.loads
This commit is contained in:
parent
69f71b4d94
commit
eede1a3685
2 changed files with 8 additions and 1 deletions
|
|
@ -5,6 +5,9 @@ Version 2.1.2
|
|||
|
||||
Unreleased
|
||||
|
||||
- Fix type annotation for ``json.loads``, it accepts str or bytes.
|
||||
:issue:`4519`
|
||||
|
||||
|
||||
Version 2.1.1
|
||||
-------------
|
||||
|
|
|
|||
|
|
@ -153,7 +153,11 @@ def dump(
|
|||
_json.dump(obj, fp, **kwargs)
|
||||
|
||||
|
||||
def loads(s: str, app: t.Optional["Flask"] = None, **kwargs: t.Any) -> t.Any:
|
||||
def loads(
|
||||
s: t.Union[str, bytes],
|
||||
app: t.Optional["Flask"] = None,
|
||||
**kwargs: t.Any,
|
||||
) -> t.Any:
|
||||
"""Deserialize an object from a string of JSON.
|
||||
|
||||
Takes the same arguments as the built-in :func:`json.loads`, with
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue