From b05a4d1f1623104e21b1f5f0e7966a8eda5691c2 Mon Sep 17 00:00:00 2001 From: cassiobotaro Date: Wed, 3 Nov 2021 09:48:09 -0300 Subject: [PATCH] Remove unecessary cast to bytes from example and code --- README.md | 2 +- shared_memory_dict/serializers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1987e33..87cc3ae 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ class JSONSerializer: return json.dumps(obj).encode() + NULL_BYTE def loads(self, data: bytes) -> dict: - data = bytes(data).split(NULL_BYTE, 1)[0] + data = data.split(NULL_BYTE, 1)[0] return json.loads(data) ``` diff --git a/shared_memory_dict/serializers.py b/shared_memory_dict/serializers.py index 617e64f..7fc0b74 100644 --- a/shared_memory_dict/serializers.py +++ b/shared_memory_dict/serializers.py @@ -18,7 +18,7 @@ def dumps(self, obj: dict) -> bytes: return json.dumps(obj).encode() + NULL_BYTE def loads(self, data: bytes) -> dict: - data = bytes(data).split(NULL_BYTE, 1)[0] + data = data.split(NULL_BYTE, 1)[0] return json.loads(data)