tmsgpack 0.2.9__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.
@@ -0,0 +1 @@
1
+ 0.2.10
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tmsgpack
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: Typed MessagePack serializer (inspired by but different from msgpack)
5
5
  Home-page: https://github.com/Yaakov-Belch/tmsgpack
6
6
  Author: Yaakov Belch
@@ -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 TMsgpackEncodingError, TMsgpackDecodingError
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
- 'TMsgpackEncodingError', 'TMsgpackDecodingError',
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 TMsgpackEncodingError, TMsgpackDecodingError
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 TMsgpackDecodingError(f'Unsupported codec_type: {codec_type}')
36
+ raise TMsgpackError(f'Unsupported codec_type: {codec_type}')
36
37
 
37
38
  def decompose_value(self, ectx):
38
- raise TMsgpackEncodingError(f'Unsupported value: {ectx.value}')
39
+ raise TMsgpackError(f'Unsupported value: {ectx.value}')
39
40
 
40
41
  def value_from_bytes(self, obj_type, data: bytes):
41
- raise TMsgpackDecodingError(f'No bytes extension defined: {obj_type=} {data=}')
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 TMsgpackDecodingError(f'No tuple extension defined: {obj_type=} {values=}')
45
+ raise TMsgpackError(f'No tuple extension defined: {obj_type=} {values=}')
45
46
 
46
47
 
47
48
  basic_codec = BasicCodec()