Reputation: 13
I looked in python documentation on tuples equivalence, however, it was not very clear description. http://docs.python.org/2/tutorial/datastructures.html
Upvotes: 1
Views: 6059
Reputation: 25559
Such things are defined in the language reference, not in the tutorial.
Tuples and lists are compared lexicographically using comparison of corresponding elements. This means that to compare equal, each element must compare equal and the two sequences must be of the same type and have the same length.
Upvotes: 10
Reputation: 880627
Two tuples are equal if the items in the tuples taken in order are equal.
Upvotes: 6