Semantics of ==

Erik Max Francis max at
Thu Mar 18 00:40:26 CET 2004

Axel Boldt wrote:

> Nowadays, an equality test which detects difference of s and w could
> be defined by comparing the strings pickle.dumps(s) and
> pickle.dumps(w).

But this is a good indication that pickle.dumps(a) == pickle.dumps(b) is
_not_ equivalent to a == b, since your s and w self-referencing lists
are a good example of where the internal structure of the two lists is
not identical but they _are_ equal according to Python's definition of
sequence comparison, as I demonstrated earlier.

 __ Erik Max Francis && max at &&
/  \ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
\__/ Liberty is the right to do whatever the law permits.
    -- Charles Louis Montesquieu

More information about the Python-list mailing list