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 serhiy.storchaka
Recipients barry, gvanrossum, scoder, serhiy.storchaka
Date 2016-11-28.21:15:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480367712.46.0.392832051675.issue24469@psf.upfronthosting.co.za>
In-reply-to
Content
It seems to me, that all builtin and extension types set tp_free to PyObject_Del, PyObject_GC_Del, or 0. The int class is the only exception.

int_free() was introduced in 200559fcc664:

> Make sure that tp_free frees the int the same way as tp_dealloc would.
> This fixes the problem that Barry reported on python-dev:
>    >>> 23000 .__class__ = bool
> crashes in the deallocator.  This was because int inherited tp_free
> from object, which uses the default allocator.

The above example no longer works:

>>> 23000 .__class__ = bool
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __class__ assignment: only for heap types

I think int_free should be removed and tp_free should be reverted to 0 (as in float type).
History
Date User Action Args
2016-11-28 21:15:12serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, barry, scoder
2016-11-28 21:15:12serhiy.storchakasetmessageid: <1480367712.46.0.392832051675.issue24469@psf.upfronthosting.co.za>
2016-11-28 21:15:12serhiy.storchakalinkissue24469 messages
2016-11-28 21:15:12serhiy.storchakacreate