Raymond Hettinger added the comment:
-0 The test "Py_SIZE(self) < self->allocated" is very cheap so I don't mind
leaving it in to handle the rare cases (or to prevent future bugs if the
list_resize logic ever changes).
--
nosy: +rhettinger
___
Pytho
New submission from Oren Milman:
in listobject.c, in case list_extend() receives an 'iterable' which isn't 'self'
nor a tuple nor a list, we have the following (heavily edited for brevity):
mn = Py_SIZE(self) + PyObject_LengthHint(iterable);
list_resize(self, mn);
... // self is exte