Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rfc8785: remove _Value type #9

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions src/rfc8785/_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
import typing
from io import BytesIO

_Value = typing.Union[
bool,
int,
str,
float,
None,
typing.List["_Value"],
typing.Tuple["_Value"],
typing.Dict[str, "_Value"],
]

_INT_MAX = 2**53 - 1
_INT_MIN = -(2**53) + 1

Expand Down Expand Up @@ -176,7 +165,7 @@ def _serialize_float(f: float, sink: typing.IO[bytes]) -> None:
sink.write(f"{first}{dot}{last}{exponent_str}".encode())


def dumps(obj: _Value) -> bytes:
def dumps(obj: typing.Any) -> bytes:
"""
Perform JCS serialization of `obj`, returning the canonical serialization
as `bytes`.
Expand All @@ -187,7 +176,7 @@ def dumps(obj: _Value) -> bytes:
return sink.getvalue()


def dump(obj: _Value, sink: typing.IO[bytes]) -> None:
def dump(obj: typing.Any, sink: typing.IO[bytes]) -> None:
"""
Perform JCS serialization of `obj` into `sink`.
"""
Expand Down