[Python-ideas] Implement comparison operators for range objects

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Oct 17 09:40:24 CEST 2011


alex23 wrote:

> I could easily see myself trying to use slices as keys in a dictionary
> dispatch.

I think the idea is that if someone writes

    x = some_dict[3:7]

it's more likely that they're trying to extract part
of a dict (which doesn't work) rather than look up
an item whose key is slice(3, 7).

-- 
Greg



More information about the Python-ideas mailing list