v1.13
Fix for custom Enum serializable classes
In the version 1.12
if you inherit both Enum
and SerializableType
classes you will get an exception TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
like in the following example:
class Example(IntEnum, SerializableType):
A = 1
B = 2
def _serialize(self):
return {"value": self.name}
@classmethod
def _deserialize(cls, value):
return Example.__members__[value["value"]]