Copy tp_as_number *after* commonClassSetup
This is important because commonClassSetup will modify tp_as_number if it exists. This causes an issue when an extension class uses multiple inheritance; it will inherit the tp_as_number from its main base, but then copy in any fields from its secondary bases. But tp_as_number points to the same struct as its parent, so it would update the parent's slots accidentally. So, move the tp_as_number copying to where CPython does it, or at least, after the calls to inherit_slots.
Showing
Please register or sign in to comment