[issue31147] a mostly useless check in list_extend()

2017-08-08 Thread Raymond Hettinger
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

[issue31147] a mostly useless check in list_extend()

2017-08-08 Thread Oren Milman
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