From 1c9081927f56dc85c8a78b3689006894391e4e77 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:10:06 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- cbor2/__init__.py | 4 ++-- cbor2/_encoder.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cbor2/__init__.py b/cbor2/__init__.py index 636f097..055f88b 100644 --- a/cbor2/__init__.py +++ b/cbor2/__init__.py @@ -4,11 +4,11 @@ from ._decoder import load as load from ._decoder import loads as loads from ._encoder import CBOREncoder as CBOREncoder +from ._encoder import canonical_encoders as canonical_encoders +from ._encoder import default_encoders as default_encoders from ._encoder import dump as dump from ._encoder import dumps as dumps from ._encoder import shareable_encoder as shareable_encoder -from ._encoder import default_encoders as default_encoders -from ._encoder import canonical_encoders as canonical_encoders from ._types import CBORDecodeEOF as CBORDecodeEOF from ._types import CBORDecodeError as CBORDecodeError from ._types import CBORDecodeValueError as CBORDecodeValueError diff --git a/cbor2/_encoder.py b/cbor2/_encoder.py index dc48836..4539a0e 100644 --- a/cbor2/_encoder.py +++ b/cbor2/_encoder.py @@ -94,9 +94,11 @@ def wrapper(encoder: CBOREncoder, value: Any) -> None: return wrapper + # type CBOREncoderDict = dict[type | tuple[str, str], Callable[[CBOREncoder, Any], None]] CBOREncoderDict = dict[type | tuple[str, str], Callable[[Any, Any], None]] + class CBOREncoder: """ The CBOREncoder class implements a fully featured `CBOR`_ encoder with @@ -736,7 +738,7 @@ def dumps( datetime_as_timestamp=datetime_as_timestamp, timezone=timezone, value_sharing=value_sharing, - encoders = encoders, + encoders=encoders, default=default, date_as_datetime=date_as_datetime, string_referencing=string_referencing, @@ -792,7 +794,7 @@ def dump( datetime_as_timestamp=datetime_as_timestamp, timezone=timezone, value_sharing=value_sharing, - encoders = encoders, + encoders=encoders, default=default, date_as_datetime=date_as_datetime, string_referencing=string_referencing,