Mark Dickinson <dicki...@gmail.com> added the comment:

And there are some similar things going on in rangeobject.c.

https://github.com/python/cpython/blob/1de60155d5d01be2924e72fb68dd13d4fd00acd7/Objects/rangeobject.c#L598

        if (r->step == _PyLong_GetOne()) {
            return idx;
        }

Again, technically "okay", since it's only a fast path and the slow path that 
follows will still do the right thing with a 1 that's not "the" 1, but it feels 
fragile.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46361>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to