[Python-Dev] Usefulness of binary compatibility accross Python versions? (original) (raw)
Random832 random832 at fastmail.com
Sun Dec 17 21:07:02 EST 2017
- Previous message (by thread): [Python-Dev] Usefulness of binary compatibility accross Python versions?
- Next message (by thread): [Python-Dev] Usefulness of binary compatibility accross Python versions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Dec 16, 2017, at 08:22, Antoine Pitrou wrote:
Typically, when adding a tpXXX slot, you also need to add a PyTPFLAGSHAVEXXX type flag to signal those static type structures that have been compiled against a recent enough PyTypeObject definition. This way, extensions compiled against Python N-1 are supposed to "still work": as they don't have PyTPFLAGSHAVEXXX set, the core Python runtime won't try to access the (non-existing) tpXXX member.
Is there any practical for of having the flag off for one slot and on for another slot that's been added later?
Could this be replaced (that is, a slot for such a thing added before it's too late) with a simple counter that goes up with each version, and any "unused" slot should have NULL or some other sentinel value? If it really is important to have the flags themselves, just add another set of flags - Py_TPFLAGS_HAVE_MORE_FLAGS.
- Previous message (by thread): [Python-Dev] Usefulness of binary compatibility accross Python versions?
- Next message (by thread): [Python-Dev] Usefulness of binary compatibility accross Python versions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]