[Python-ideas] Implement comparison operators for range objects

Nick Coghlan ncoghlan at gmail.com
Thu Oct 13 04:44:12 CEST 2011


On Thu, Oct 13, 2011 at 11:45 AM, Eric Snow <ericsnowcurrently at gmail.com> wrote:
> Unless I misunderstood, Guido is basically saying the same thing (the
> "exposing" part, that is).
>
> +1 on exposing start, step and end
> +1 on leaving it at that (unless it turns out to be a common case)

My reading is that Guido has reserved judgment on the second part for
now. Options are:

- do nothing for 3.3 (+0 from me)
- make sequence comparison the default (+1 from me)
- make start/stop/step comparison the default (-1 from me)

If we do either of the latter, range.__hash__ should be updated
accordingly (since 3.x range objects are currently hashable due to
their reliance on the default identity comparison)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list