Message 352672 - Python tracker
Message352672
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 | ammar2 |
|---|---|
| Recipients | ammar2, docs@python |
| Date | 2019-09-17.23:27:39 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1568762859.98.0.230733966822.issue38206@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
When dealing with a heap allocated type (https://docs.python.org/3/c-api/typeobj.html#Py_TPFLAGS_HEAPTYPE / PyType_FromSpec), if the type has a custom tp_dealloc function then it MUST decrement the references to the type object itself due to this code block: https://github.com/python/cpython/blob/4a12a178f4a6b9a59d97fecc727f2b6b28dfc85f/Objects/typeobject.c#L1189-L1192 The only mention of this is within the whatsnew entry for 3.8: https://github.com/python/cpython/commit/364f0b0f19cc3f0d5e63f571ec9163cf41c62958#diff-77c703d9a958f6a4b0dc2f692b3fd5b3 This error was made in https://github.com/python/cpython/pull/16127#pullrequestreview-288312751 and https://github.com/python/cpython/pull/16071#pullrequestreview-287819525 It seems like a common pitfall, let's add a note about this in the doc. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-09-17 23:27:40 | ammar2 | set | recipients: + ammar2, docs@python |
| 2019-09-17 23:27:39 | ammar2 | set | messageid: <1568762859.98.0.230733966822.issue38206@roundup.psfhosted.org> |
| 2019-09-17 23:27:39 | ammar2 | link | issue38206 messages |
| 2019-09-17 23:27:39 | ammar2 | create | |