On Mon, 30 Jul 2007 11:16:01 -0400, Steve Holden wrote: > Marc 'BlackJack' Rintsch wrote: >> First I thought: Why the unnecessary list comprehension but to my surprise: >> >> In [33]: xrange(42) == xrange(42) >> Out[33]: False >> >> That's strange. >> > Not so strange really. The two xrange objects are different (though I > confess I haven't looked to see how they implement comparisons), but > iterating over them produces the same result.
They are different objects, so are range(23) and another range(23) but those compare equal. Somehow I expected two seemingly equal `xrange` objects compare equal too. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list