Ask Your Question

Revision history [back]

In this example R and S are the same Python object. You are probably comparing different instances of the same class. See here for information on how to customize the comparison operations in Python.

Especially this sentence:

Instances of a class normally compare as non-equal unless the class defines the __cmp__() method. Refer to Basic customization) for information on the use of this method to effect object comparisons.