Re: [Python-Dev] Why doesn't `functools.total_ordering` use the existing ordering methods?

2011-04-26 Thread Lennart Regebro
On Mon, Apr 25, 2011 at 20:43, cool-RR cool...@cool-rr.com wrote: Hello, Today I was trying to use `total_ordering` for the first time. I was expecting that in order to implement e.g. `x y` it would do `not x y and not x == y`, assuming that `__lt__`  and `__eq__` are defined. But I see it

[Python-Dev] Why doesn't `functools.total_ordering` use the existing ordering methods?

2011-04-25 Thread cool-RR
Hello, Today I was trying to use `total_ordering` for the first time. I was expecting that in order to implement e.g. `x y` it would do `not x y and not x == y`, assuming that `__lt__` and `__eq__` are defined. But I see it just does `y x`, which is problematic. For example if you have a

Re: [Python-Dev] Why doesn't `functools.total_ordering` use the existing ordering methods?

2011-04-25 Thread Raymond Hettinger
On Apr 25, 2011, at 11:43 AM, cool-RR wrote: Today I was trying to use `total_ordering` for the first time. I was expecting that in order to implement e.g. `x y` it would do `not x y and not x == y`, assuming that `__lt__` and `__eq__` are defined. This was fixed. The current code has: