tmsgpack 0.2.7__tar.gz → 0.2.10__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.10/Automatic-Version +1 -0
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/PKG-INFO +1 -1
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/tmsgpack/__init__.py +2 -2
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/tmsgpack/api.py +6 -5
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/tmsgpack/cython.c +8592 -3961
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/tmsgpack/cython.pyx +134 -51
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/tmsgpack.egg-info/PKG-INFO +1 -1
- tmsgpack-0.2.7/Automatic-Version +0 -1
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/COPYING +0 -0
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/LICENSE +0 -0
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/MANIFEST.in +0 -0
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/README.md +0 -0
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/pyproject.toml +0 -0
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/setup.cfg +0 -0
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/setup.py +0 -0
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/tmsgpack.egg-info/SOURCES.txt +0 -0
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/tmsgpack.egg-info/dependency_links.txt +0 -0
- {tmsgpack-0.2.7 → tmsgpack-0.2.10}/tmsgpack.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.10
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
from .cython import __version__
|
|
4
4
|
from .cython import EncodeBuffer, DecodeBuffer
|
|
5
5
|
from .cython import ebuf_put_value, dbuf_take_value
|
|
6
|
-
from .cython import
|
|
6
|
+
from .cython import TMsgpackError
|
|
7
7
|
from .api import EncodeDecode, BasicCodec, basic_codec
|
|
8
8
|
__all__ = [
|
|
9
9
|
'EncodeDecode', 'basic_codec', 'BasicCodec',
|
|
10
10
|
'EncodeBuffer', 'DecodeBuffer',
|
|
11
11
|
'ebuf_put_value', 'dbuf_take_value',
|
|
12
|
-
'
|
|
12
|
+
'TMsgpackError',
|
|
13
13
|
]
|
|
14
14
|
|
|
@@ -2,7 +2,7 @@ from typing import Any, Tuple
|
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from tmsgpack.cython import EncodeBuffer, DecodeBuffer
|
|
4
4
|
from tmsgpack.cython import ebuf_put_value, dbuf_take_value
|
|
5
|
-
from tmsgpack.cython import
|
|
5
|
+
from tmsgpack.cython import TMsgpackError
|
|
6
6
|
|
|
7
7
|
class EncodeDecode:
|
|
8
8
|
def encode(self, value, target=None):
|
|
@@ -28,20 +28,21 @@ class EncodeDecode:
|
|
|
28
28
|
@dataclass
|
|
29
29
|
class BasicCodec(EncodeDecode):
|
|
30
30
|
sort_keys = True
|
|
31
|
+
use_cache = False
|
|
31
32
|
def prep_encode(self, value, target): return [None, self, value]
|
|
32
33
|
|
|
33
34
|
def decode_codec(self, codec_type, source):
|
|
34
35
|
if codec_type is None: return self
|
|
35
|
-
raise
|
|
36
|
+
raise TMsgpackError(f'Unsupported codec_type: {codec_type}')
|
|
36
37
|
|
|
37
38
|
def decompose_value(self, ectx):
|
|
38
|
-
raise
|
|
39
|
+
raise TMsgpackError(f'Unsupported value: {ectx.value}')
|
|
39
40
|
|
|
40
41
|
def value_from_bytes(self, obj_type, data: bytes):
|
|
41
|
-
raise
|
|
42
|
+
raise TMsgpackError(f'No bytes extension defined: {obj_type=} {data=}')
|
|
42
43
|
|
|
43
44
|
def value_from_list(self, obj_type, values: list):
|
|
44
|
-
raise
|
|
45
|
+
raise TMsgpackError(f'No tuple extension defined: {obj_type=} {values=}')
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
basic_codec = BasicCodec()
|