We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8c8f32 commit f46ba55Copy full SHA for f46ba55
Objects/longobject.c
@@ -5882,6 +5882,8 @@ static Py_ssize_t
5882
int___sizeof___impl(PyObject *self)
5883
/*[clinic end generated code: output=3303f008eaa6a0a5 input=9b51620c76fc4507]*/
5884
{
5885
+ /* using Py_MAX(..., 1) because we always allocate space for at least
5886
+ one digit, even though the integer zero has a Py_SIZE of 0 */
5887
Py_ssize_t ndigits = Py_MAX(Py_ABS(Py_SIZE(self)), 1);
5888
return Py_TYPE(self)->tp_basicsize + Py_TYPE(self)->tp_itemsize * ndigits;
5889
}
0 commit comments