12 Oct
2011
12 Oct
'11
10:57 p.m.
Guido van Rossum wrote:
I beg to differ with all those who want range(0, 10, 2) == range(0, 11, 2).
I think practicality should beat purity here -- if the same results will be generated, then the ranges are the same and should be equal, no matter which exact parameters were used to create them.
After all the repr() shows the end point that was requested, not the end point after "normalization" (or whatever you'd call it) so the three parameters that went in should be considered state.
OTOH range(10) == range(0, 10) == range(0, 10, 1).
Exactly. ~Ethan~