[issue2603] Make range __eq__ work

Alexander Belopolsky report at bugs.python.org
Sat Apr 26 02:22:42 CEST 2008


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

With respect to range_eq8_normalize2.patch, it is unusual to have a 
function that consumes a reference to its argument.  I would combine 
normalize_stop with PyNumber_Index and make it similar to validate_step 
with respect to reference counting.

Note that if you choose stop = start + len*step normaization, you will 
not need to create 'one' in normalize_stop.

With your patch I see

>>> range(0,6,2)
range(0, 6, 2)
>>> range(0,5,2)
range(0, 5, 2)

I would expect one of these ranges normalized.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2603>
__________________________________


More information about the Python-bugs-list mailing list