commit de4ea09398a3d3e8a71213c4b6905be979f47626
Author: Dmitrii Shcherbakov <email address hidden>
Date: Sat Mar 16 21:13:33 2019 +0300
Task context: implement comparison operators
__cmp__ is no longer used in python3
Other operators need to be defined instead.
https://docs.python.org/3/whatsnew/3.0.html#ordering-comparisons
"The cmp() function should be treated as gone, and the __cmp__() special
method is no longer supported. Use __lt__() for sorting, __eq__() with
__hash__(), and other rich comparisons as needed. (If you really need
the cmp() functionality, you could use the expression (a > b) - (a < b)
as the equivalent for cmp(a, b).)"
Reviewed: https:/ /review. openstack. org/643717 /git.openstack. org/cgit/ openstack/ rally/commit/ ?id=de4ea09398a 3d3e8a71213c4b6 905be979f47626
Committed: https:/
Submitter: Zuul
Branch: master
commit de4ea09398a3d3e 8a71213c4b6905b e979f47626
Author: Dmitrii Shcherbakov <email address hidden>
Date: Sat Mar 16 21:13:33 2019 +0300
Task context: implement comparison operators
__cmp__ is no longer used in python3
Other operators need to be defined instead.
https:/ /docs.python. org/3/whatsnew/ 3.0.html# ordering- comparisons
"The cmp() function should be treated as gone, and the __cmp__() special
method is no longer supported. Use __lt__() for sorting, __eq__() with
__hash__(), and other rich comparisons as needed. (If you really need
the cmp() functionality, you could use the expression (a > b) - (a < b)
as the equivalent for cmp(a, b).)"
https:/ /www.python. org/dev/ peps/pep- 0207/
This change does it based on get_order and class meta properties.
Downstream projects that rely on context comparison (such as openstack) will benefit from this change.
rally-
Change-Id: I4991acccefd475 4e209feafd5e24d 03c76c283f8 4d3576beb737bb7 e955c5f2132 8fd4707a5576204 dee69a3f307
Depends-On: I42db6045ae88c3
Needed-By: I6bb31fe1d3f79a
Partial-Bug: #1819274