[issue4174] Performance optimization for min() and max() over lists
Hrvoje Nikšić
report at bugs.python.org
Thu Oct 23 13:12:26 CEST 2008
Hrvoje Nikšić <hniksic at gmail.com> added the comment:
Note that the item retrieved by PyList_GET_ITEM must be increffed before
being passed to the function. Otherwise mutating the list can remove
the item from the list and destroy the underlying object, in which case
the current maxitem can refer to a freed object. This pitfall is
described in http://docs.python.org/extending/extending.html#thin-ice in
some detail.
----------
nosy: +hniksic
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4174>
_______________________________________
More information about the Python-bugs-list
mailing list