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 pitrou
Recipients Eric Cousineau, docs@python, pitrou
Date 2017-12-19.17:13:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <08662082-d18c-003a-ce80-4450d851de35@free.fr>
In-reply-to <1513701998.29.0.213398074469.issue32377@psf.upfronthosting.co.za>
Content
Le 19/12/2017 à 17:46, Eric Cousineau a écrit :
> 
> My current hack is to call `_PyGC_SET_FINALIZED(self, 0)` - may I ask if there is a simpler way to do this?

Well... perhaps you could create another PyObject (it's just a wrapper,
right?) since the old one doesn't have any outside references to it
remaining.

Note that calling __del__ only once is also how PyPy works:
http://doc.pypy.org/en/latest/cpython_differences.html#differences-related-to-garbage-collection-strategies

If there is some demand we could expose a higher-level spelling of
`_PyGC_SET_FINALIZED(self, 0)`.
History
Date User Action Args
2017-12-19 17:13:08pitrousetrecipients: + pitrou, docs@python, Eric Cousineau
2017-12-19 17:13:07pitroulinkissue32377 messages
2017-12-19 17:13:07pitroucreate