@@ -931,8 +931,11 @@ has a signature similar to `dataclasses.make_dataclass`. See
931931 Point(x = 1.0 , y = 2.0 )
932932
933933
934+ Advanced
935+ --------
936+
934937Metaclasses
935- -----------
938+ ~~~~~~~~~~~
936939
937940You can define project-wide :class: `msgspec.Struct ` policies at class-creation
938941time by extending the :class: `msgspec.StructMeta ` metaclass.
@@ -1002,19 +1005,22 @@ abstract base Structs (like ``Event``) cannot be instantiated, and
10021005:func: `isinstance ` and :func: `issubclass ` checks behave the same as for normal
10031006ABCs.
10041007
1005- .. warning ::
1008+ .. important ::
10061009
1007- Mixing :class: `msgspec.StructMeta ` with arbitrary metaclasses
1008- is not supported. Only combinations involving :class: `abc.ABCMeta `
1009- (or its subclasses) are guaranteed to work. Prefer using
1010- :meth: `object.__init_subclass__ ` on a :class: `msgspec.Struct ` base class
1011- instead of additional custom metaclasses.
1010+ - Classes with a :class: `msgspec.StructMeta `-derived metaclass do not
1011+ *technically * need to inherit from :class: `msgspec.Struct `, but it is
1012+ recommended to do so for static typing support in IDEs and other tools.
1013+ - Mixing :class: `msgspec.StructMeta ` with arbitrary metaclasses
1014+ is not supported. Only combinations involving :class: `abc.ABCMeta `
1015+ (or its subclasses) are guaranteed to work. Prefer using
1016+ :meth: `object.__init_subclass__ ` on a :class: `msgspec.Struct ` base class
1017+ instead of additional custom metaclasses.
10121018
10131019
10141020.. _struct-gc :
10151021
1016- Disabling Garbage Collection (Advanced)
1017- ---------------------------------------
1022+ Disabling Garbage Collection
1023+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10181024
10191025.. warning ::
10201026
0 commit comments