In Python 3 __ne__ by default delegates to __eq__ and inverts the
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining
__eq__(), one should also define __ne__() so that the operators
will behave as expected.
[1]https://docs.python.org/2/reference/datamodel.html#object.__ne__
Also fixes spelling errors:resoruces.
Reviewed: https:/ /review. openstack. org/337435 /git.openstack. org/cgit/ openstack/ python- keystoneclient/ commit/ ?id=ef34175095d 92a117fda149ad8 a2e216e3a2b78c
Committed: https:/
Submitter: Jenkins
Branch: master
commit ef34175095d92a1 17fda149ad8a2e2 16e3a2b78c
Author: yuyafei <email address hidden>
Date: Tue Jul 5 15:21:02 2016 +0800
Add __ne__ built-in function
In Python 3 __ne__ by default delegates to __eq__ and inverts the /docs.python. org/2/reference /datamodel. html#object. __ne__
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining
__eq__(), one should also define __ne__() so that the operators
will behave as expected.
[1]https:/
Also fixes spelling errors:resoruces.
Change-Id: Iae4ce0fe84fae8 10711cc8c3fdb94 eb9ca1d772e
Closes-Bug: #1586268