tmsgpack 0.2.2__tar.gz → 0.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tmsgpack-0.2.7/Automatic-Version +1 -0
- {tmsgpack-0.2.2/tmsgpack.egg-info → tmsgpack-0.2.7}/PKG-INFO +1 -1
- {tmsgpack-0.2.2 → tmsgpack-0.2.7}/setup.cfg +1 -1
- {tmsgpack-0.2.2 → tmsgpack-0.2.7}/setup.py +1 -1
- tmsgpack-0.2.7/tmsgpack/__init__.py +14 -0
- {tmsgpack-0.2.2/tmsgpack/cython → tmsgpack-0.2.7/tmsgpack}/api.py +5 -4
- tmsgpack-0.2.2/tmsgpack/cython/tmsgpack.c → tmsgpack-0.2.7/tmsgpack/cython.c +18641 -14656
- tmsgpack-0.2.2/tmsgpack/cython/tmsgpack.pyx → tmsgpack-0.2.7/tmsgpack/cython.pyx +161 -96
- {tmsgpack-0.2.2 → tmsgpack-0.2.7/tmsgpack.egg-info}/PKG-INFO +1 -1
- tmsgpack-0.2.7/tmsgpack.egg-info/SOURCES.txt +16 -0
- tmsgpack-0.2.2/tmsgpack/__init__.py +0 -22
- tmsgpack-0.2.2/tmsgpack/cython/__init__.py +0 -0
- tmsgpack-0.2.2/tmsgpack/pure_python/__init__.py +0 -11
- tmsgpack-0.2.2/tmsgpack/pure_python/api.py +0 -98
- tmsgpack-0.2.2/tmsgpack/pure_python/buffers.py +0 -77
- tmsgpack-0.2.2/tmsgpack/pure_python/engine.py +0 -218
- tmsgpack-0.2.2/tmsgpack/pure_python/exceptions.py +0 -2
- tmsgpack-0.2.2/tmsgpack.egg-info/SOURCES.txt +0 -21
- {tmsgpack-0.2.2 → tmsgpack-0.2.7}/COPYING +0 -0
- {tmsgpack-0.2.2 → tmsgpack-0.2.7}/LICENSE +0 -0
- {tmsgpack-0.2.2 → tmsgpack-0.2.7}/MANIFEST.in +0 -0
- {tmsgpack-0.2.2 → tmsgpack-0.2.7}/README.md +0 -0
- {tmsgpack-0.2.2 → tmsgpack-0.2.7}/pyproject.toml +0 -0
- {tmsgpack-0.2.2 → tmsgpack-0.2.7}/tmsgpack.egg-info/dependency_links.txt +0 -0
- {tmsgpack-0.2.2 → tmsgpack-0.2.7}/tmsgpack.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.7
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""tmsgpack - Typed MessagePack serializer"""
|
|
2
|
+
|
|
3
|
+
from .cython import __version__
|
|
4
|
+
from .cython import EncodeBuffer, DecodeBuffer
|
|
5
|
+
from .cython import ebuf_put_value, dbuf_take_value
|
|
6
|
+
from .cython import TMsgpackEncodingError, TMsgpackDecodingError
|
|
7
|
+
from .api import EncodeDecode, BasicCodec, basic_codec
|
|
8
|
+
__all__ = [
|
|
9
|
+
'EncodeDecode', 'basic_codec', 'BasicCodec',
|
|
10
|
+
'EncodeBuffer', 'DecodeBuffer',
|
|
11
|
+
'ebuf_put_value', 'dbuf_take_value',
|
|
12
|
+
'TMsgpackEncodingError', 'TMsgpackDecodingError',
|
|
13
|
+
]
|
|
14
|
+
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from typing import Any, Tuple
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
-
from tmsgpack.cython
|
|
4
|
-
from tmsgpack.cython
|
|
3
|
+
from tmsgpack.cython import EncodeBuffer, DecodeBuffer
|
|
4
|
+
from tmsgpack.cython import ebuf_put_value, dbuf_take_value
|
|
5
|
+
from tmsgpack.cython import TMsgpackEncodingError, TMsgpackDecodingError
|
|
5
6
|
|
|
6
7
|
class EncodeDecode:
|
|
7
8
|
def encode(self, value, target=None):
|
|
@@ -33,8 +34,8 @@ class BasicCodec(EncodeDecode):
|
|
|
33
34
|
if codec_type is None: return self
|
|
34
35
|
raise TMsgpackDecodingError(f'Unsupported codec_type: {codec_type}')
|
|
35
36
|
|
|
36
|
-
def decompose_value(self,
|
|
37
|
-
raise TMsgpackEncodingError(f'Unsupported value: {value}')
|
|
37
|
+
def decompose_value(self, ectx):
|
|
38
|
+
raise TMsgpackEncodingError(f'Unsupported value: {ectx.value}')
|
|
38
39
|
|
|
39
40
|
def value_from_bytes(self, obj_type, data: bytes):
|
|
40
41
|
raise TMsgpackDecodingError(f'No bytes extension defined: {obj_type=} {data=}')
|