MORSECorp / snappiershot

Apache License 2.0
30 stars 2 forks source link

Add support of __slots__ classes #57

Closed bbonenfant closed 2 years ago

bbonenfant commented 3 years ago

Currently we support a default encoding of classes using their underlying __dict__. This does not cover all classes as some classes are optimized to use __slots__ instead of having a __dict__.

To accomplish this, a branch will need to be added to the default_encode_value function in snappiershot.serializers.utils that checks for a __slots__ attribute and performs the encoding.