[Python-ideas] Exploiting type-homogeneity in list.sort() (again!)

Elliot Gorokhovsky elliot.gorokhovsky at gmail.com
Mon Mar 6 01:28:16 EST 2017


On Sun, Mar 5, 2017 at 11:21 PM Jelle Zijlstra <jelle.zijlstra at gmail.com>
wrote:

>
> I think using a global is unsafe even without multithreading, because
> the compare function itself could end up doing list.sort() (it's
> calling arbitrary Python code after all).
>

Right, of course. So, clearly, the only safe solution is to just keep
everything in local scope and pass the compare function pointer into every
function that calls ISLT or IFLT. Too bad. I'll rewrite the patch to
implement this and open a new issue on the bug tracker (and close my
current issue).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170306/610e2a74/attachment.html>


More information about the Python-ideas mailing list