compare range objects

Ian Kelly ian.g.kelly at gmail.com
Thu Oct 20 14:14:56 EDT 2011


On Thu, Oct 20, 2011 at 12:00 PM, Hans Mulder <hansmu at xs4all.nl> wrote:
>> There's already a discussion about this on python-ideas.  But somebody
>> please tell me, why would you ever need to compare ranges?
>
> It could be useful if you're unit-testing a function that returns a range.

Easy:

list(range1) == list(range2)



More information about the Python-list mailing list