[issue28397] Faster index range checks

STINNER Victor report at bugs.python.org
Tue Oct 11 10:39:06 EDT 2016


STINNER Victor added the comment:

Serhiy Storchaka: "I opened this issue because this optimization already was applied to deque (issue23553)"

Ah, change 1e89094998b2 written by Raymond Hettinger last year, Raymond who wrote (msg278397): "Don't change the code in the collections module.  While semantically valid, the change obfuscates the code." :-)

To stay consistent, I suggest to revert the useless micro-optimization 1e89094998b2. Python uses Py_ssize_t instead of size_t to support "i >= 0" checks", it's a deliberate choice to catch bugs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28397>
_______________________________________


More information about the Python-bugs-list mailing list