Fixed typing.

This commit is contained in:
Leo Vasanko
2026-06-13 00:59:18 +00:00
parent fe66483477
commit 17e12e5180
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ from typing import Any, TypeVar
import msgspec
from kanta.serialization.framing import LineFramer
from kanta.serialization.framing import Framer, LineFramer
T = TypeVar("T")
@@ -14,7 +14,7 @@ T = TypeVar("T")
class JsonSerializer:
"""Line-based JSON serializer."""
framer_cls = LineFramer
framer_cls: type[Framer] = LineFramer
def encode(self, obj: Any) -> bytes:
return msgspec.json.encode(obj)
+2 -2
View File
@@ -6,7 +6,7 @@ from typing import Any, TypeVar
import msgspec
from kanta.serialization.framing import BinFramer
from kanta.serialization.framing import BinFramer, Framer
T = TypeVar("T")
@@ -14,7 +14,7 @@ T = TypeVar("T")
class MsgPackSerializer:
"""Binary serializer using MessagePack format."""
framer_cls = BinFramer
framer_cls: type[Framer] = BinFramer
def encode(self, obj: Any) -> bytes:
return msgspec.msgpack.encode(obj)