[Python-ideas] Should range() == range(0)?

Greg Ewing greg.ewing at canterbury.ac.nz
Mon May 7 07:16:39 CEST 2012


Terry Reedy wrote:

> I believe there was consideration given to similarly normalizing ranges 
> so that equal ranges (in 3.3, see below) would have the same start, 
> stop, and step attributes.

That might make sense if there were a well-defined algebra of
range objects, but there isn't. For example, concatenating the
sequences represented by two ranges with different step sizes
results in a sequence that can't be represented by a single
range object.

Also I can't remember seeing a plethora of use cases for
comparing range objects.

-- 
Greg



More information about the Python-ideas mailing list