On 9/9/21 12:32 am, Simon Cross wrote:
There is also some value to CPython itself in making (especially) the PyType memory structure opaque, which is that it allows CPython itself to evolve that structure.
How does this change move the needle on that goal? The macros become static inline functions defined in the C headers. Nothing changes in the C struct itself. The fields still need to be accessible, whether the access is via a macro or via a static inline function: the goal is that both compile to a (ptr + offset). This enables better compiler error messages, but does not move any closer to moving field access into a function call required for a truly opaque memory structure. Changing to a function call would have performance implications that would probably prevent its adoption. Or maybe I misunderstand what you mean by an opaque memory structure?
Matti