Open steve-s opened 2 years ago
In general, it is a question if we should use flags
in HPy. Maybe HPy should have bool
(or int
?) fields in HPyType_Spec
for individual flags instead: that is safer, easier to use and migration from CPython API should be simple enough.
Currently HPy just copies
HPyType_Spec
flags toPyType_Spec
:and the user is expected to use at least
HPy_TPFLAGS_DEFAULT
in theirHPyType_Spec
, which exposes CPython specific flags in HPy headers:HPy_TPFLAGS_BASETYPE
andHPy_TPFLAGS_HAVE_GC
).0
as the default value? We can still also treat what wasHPy_TPFLAGS_DEFAULT
as another way of specifying it, but without exposing a constant for it (and maybe with a warning?).0
and suggest to useHPy_TPFLAGS_DEFAULT