Skip to content

Commit 594efa4

Browse files
committed
fix: make codable classes picklable
1 parent b7a4c87 commit 594efa4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tsrkit_types/itf/codable.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,7 @@ def _check_buffer_size(cls, buffer: bytearray, size: int, offset: int) -> None:
8080
offset: The offset at which to start encoding the value.
8181
"""
8282
if len(buffer) - offset < size:
83-
raise ValueError("Buffer too small to encode value")
83+
raise ValueError("Buffer too small to encode value")
84+
85+
def __reduce__(self):
86+
return (self.__class__.decode, (self.encode(),))

0 commit comments

Comments
 (0)