Guido van Rossum wrote:
On Fri, Oct 14, 2011 at 1:10 PM, Ethan Furman firstname.lastname@example.org wrote:
A range is a sequence -- why should identical sequences not compare equal?
There's no such convention anywhere in Python. (1, 2) != [1, 2]. collections/abc.py does not define __eq__ for sequences.
Okay, add in 'of the same type'.
Have you personally written code that compares ranges?
I have not. Nevertheless, I expect a sequence object of type SomeType that returns the identical items, in the same order, as another sequence object of type SomeType to compare equal to that other sequence object no matter how the two objects happened to be created.