Types, modules and their attributes (i.e. methods, members, slots, get-set descriptors) are defined in a similar way. Section HPy Type documents the type-specific and HPy Module documents the module-specific part. Section HPy Definition documents how to define attributes for both, types and modules.
hpy/hpytype.h
autogen/public_api.h
hpy/hpymodule.h
Defining slots, methods, members, and get-set descriptors for types and modules is done with HPy definition (represented by C struct :cHPyDef
).
hpy/hpydef.h