Interfaces for precision levels
Closed this issue · 1 comments
Problem
Python provides no interface for defining precision int or float; has no support for uint, and differing precision gives different results in message pack.
Solution
Create a class for each precision level and/or support numpy types directly. Both would make the most sense.
msgpack type system doesn't have uint or int8 too.
https://github.com/msgpack/msgpack/blob/master/spec.md#type-system
uint and int8 are just format, used inner msgpack.
When serializing python int(8), it is encoded into msgpack uint8(8).
https://github.com/msgpack/msgpack/blob/master/spec.md#serialization-type-to-format-conversion
If an object can be represented in multiple possible output formats, serializers SHOULD use the format which represents the data in the smallest number of bytes.
Adding types for each inner format leads people to abuse msgpack. Abusing msgpack makes msgpack less interoperable. So I won't support it.