jcrist / msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML

Home Page:https://jcristharif.com/msgspec/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating a msgspec.Struct abstract class

arthurbrenno opened this issue · comments

Question

Hi. How can I create a class that is a msgspec.struct class, but it is not intended to be instantiated directly?

Example:

class Entity(msgspec.Struct, ABC):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
make[1]: *** [run] Error 1