msgspec icon indicating copy to clipboard operation
msgspec copied to clipboard

Creating a msgspec.Struct abstract class

Open arthurbrenno opened this issue 1 year ago • 0 comments
trafficstars

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

arthurbrenno avatar Aug 25 '24 12:08 arthurbrenno