2011/9/23 Ethan Furman <et...@stoneleaf.us>:
> Benjamin Peterson wrote:
>>
>> 2011/9/23 Ethan Furman <et...@stoneleaf.us>:
>
>>>
>>>
>>> Follow-up question: since the original range returned lists, and
>>> comparisons
>>> do make sense for lists, should the new range also implement them?
>>
>> What would be the use-case?
>
> The only reason I'm aware of at the moment is to prevent loss of
> functionality from 2.x range to 3.x range.

range comparisons in 2.x have no functionality.

>
>>> I note
>>> that it does implement __contains__, __getitem__, count, and index in the
>>> same way that list does.
>>
>> That's because it implements the Sequence ABC.
>
> So the question becomes, Why does it implement the Sequence ABC? Because the
> original range returned a list and those operations made sense?

I'm not sure what the history is.



-- 
Regards,
Benjamin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to