This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Christian.Tismer
Recipients Christian.Tismer, Dormouse759, docs@python, loewis, ncoghlan, petr.viktorin, serhiy.storchaka
Date 2018-06-02.10:30:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527935409.08.0.592728768989.issue26979@psf.upfronthosting.co.za>
In-reply-to
Content
There is another catch that belongs in the same category.

There is line 2841 in typeobject.c

    if (type->tp_dealloc == NULL) {
        /* It's a heap type, so needs the heap types' dealloc.
           subtype_dealloc will call the base type's tp_dealloc, if
           necessary. */
        type->tp_dealloc = subtype_dealloc;
    }

When converting the PySide types, it became a real problem. Types with an
existing tp_dealloc behaved normal, but those with tp_dealloc=NULL
gave segfaults. I ended up supplying a default dummy_dealloc()
that is just there to occupy this slot. Then it worked.


And another source of incompatibility:

PyType_FromSpec() enforces a tp_name field to be dotted, to compute a module
name. Very annoying incompatibility that could be avoided.


A small but remarkable glitch:
Most fields of the PyType_Spec/PyType_Slot combo are copied, but some are not.
So expect funny behaviour when creating types with dynamically generated
specs without strdup. That should IMHO be changed.
History
Date User Action Args
2018-06-02 10:30:09Christian.Tismersetrecipients: + Christian.Tismer, loewis, ncoghlan, petr.viktorin, docs@python, serhiy.storchaka, Dormouse759
2018-06-02 10:30:09Christian.Tismersetmessageid: <1527935409.08.0.592728768989.issue26979@psf.upfronthosting.co.za>
2018-06-02 10:30:09Christian.Tismerlinkissue26979 messages
2018-06-02 10:30:08Christian.Tismercreate