mirror of
https://github.com/sprockets/sprockets.mixins.mediatype.git
synced 2025-01-19 19:15:24 +00:00
Add type_info.JsonDumpable.
This commit is contained in:
parent
e01bc1889d
commit
680f4d8a45
2 changed files with 5 additions and 1 deletions
|
@ -88,7 +88,7 @@ class JSONTranscoder(handlers.TextContentHandler):
|
|||
json.loads(str_repr, **self.load_options))
|
||||
|
||||
def dump_object(self,
|
||||
obj: type_info.Serializable) -> typing.Union[str, float]:
|
||||
obj: type_info.Serializable) -> type_info.JsonDumpable:
|
||||
"""
|
||||
Called to encode unrecognized object.
|
||||
|
||||
|
|
|
@ -77,6 +77,10 @@ MsgPackable = typing.Union[None, bool, bytes, typing.Dict[typing.Any,
|
|||
int, typing.List[typing.Any], str]
|
||||
"""Set of types that the underlying msgpack library can serialize."""
|
||||
|
||||
JsonDumpable = typing.Union[None, bool, typing.Mapping[typing.Any, typing.Any],
|
||||
float, int, typing.Sequence[typing.Any], str, None]
|
||||
"""Set of types that the underlying msgpack library can serialize."""
|
||||
|
||||
|
||||
class Transcoder(Protocol):
|
||||
"""Object that transforms objects to bytes and back again.
|
||||
|
|
Loading…
Reference in a new issue