True if two objects are logically equal, False otherwise.
If the first argument, x, has an equals method then it is used, and in this case equals(x, y) is equivalent to x.equals(y).
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> x
<CF Field: rain(10,20)>
>>> cf.equals(x,x)
True
>>> cf.equals(1.0, 1.0)
True
>>> cf.equals(1.0, 33)
False
>>> cf.equals('a', 'a')
True
>>> cf.equals('a', 'b')
False
>>> type(x), x.dtype
(<type 'numpy.ndarray'>, dtype('int64'))
>>> y=x.copy()
>>> cf.equals(x, y)
True
>>> cf.equals(x, x+1)
False
>>> class A(object): pass
>>> a=A()
>>> b=A()
>>> cf.equals(a, a)
True
>>> cf.equals(a, b)
False