bt2: remove __le__() method already provided by @total_ordering
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 26 Jun 2019 15:07:53 +0000 (11:07 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 18 Jul 2019 15:53:33 +0000 (11:53 -0400)
commit0b095f9485c9bc42acb41dcd2b56863c18636fa5
tree52cde58ed4b6938231701c5ae4834ea375742e7a
parent90107d5119fe7e72c83bd8fc71e9939a9b6c6127
bt2: remove __le__() method already provided by @total_ordering

The `@total_ordering` decorator already provide all the rich comparison
methods because we implement the __lt__() and __eq__() methods. So there
is no need to implement any other rich comparison methods.

I chose __lt__() arbitrarily but it could have been __le__(), __gt__(),
or __ge__().

Documentation on `@total_ordering` [1]:
  The class must define one of __lt__(), __le__(), __gt__(), or
  __ge__(). In addition, the class should supply an __eq__() method.

[1]: https://docs.python.org/3/library/functools.html#functools.total_ordering

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I4c09ae725acadc59aa17d03063136ffc0dd854c2
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1544
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/bindings/python/bt2/bt2/field.py
src/bindings/python/bt2/bt2/value.py
This page took 0.025349 seconds and 4 git commands to generate.