[issue41902] Micro optimization for range.index if step is 1

Mark Dickinson report at bugs.python.org
Thu Oct 1 12:26:44 EDT 2020


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Do we need another fast-path in long_div(a, b) when b == _PyLong_One? Just return a in this case.

I'd much prefer not. Every extra fast path check costs time for the general case, and there's no strong reason to expect people to be dividing by one. The range code seems like the right place for this optimization, not the long-divide code.

----------
nosy: +mark.dickinson

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41902>
_______________________________________


More information about the Python-bugs-list mailing list