STINNER Victor added the comment: I suggest to try to inline PyList_GetItem: use PyList_GET_ITEM and raise the exception manually if needed.
I'm not sure that it's ok to add PyLong_AsSize_t() to the slow path. Copy the code in each if? A macro can help. ---------- title: ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 -> ceval: Optimize list _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26280> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com