[Python-ideas] Implement comparison operators for range objects

Guido van Rossum guido at python.org
Thu Oct 13 00:38:38 CEST 2011


I beg to differ with all those who want range(0, 10, 2) == range(0,
11, 2). 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).

-- 
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list