[New-bugs-announce] [issue36117] Allow rich comparisons for real-valued complex objects.

Brandt Bucher report at bugs.python.org
Tue Feb 26 03:04:22 EST 2019


New submission from Brandt Bucher <brandtbucher at gmail.com>:

Currently, it isn't legal to perform <, >, <=, or >= rich comparisons on any complex objects, even though these operations are mathematically well-defined for real numbers.

The attached PR addresses this by defining rich comparisons for real-valued complex objects against subclasses of int and float, as well as for decimal.Decimal and fractions.Fraction types. They still raise TypeErrors when either of the operands has a nonzero imaginary part.

----------
components: Interpreter Core
messages: 336628
nosy: brandtbucher
priority: normal
severity: normal
status: open
title: Allow rich comparisons for real-valued complex objects.
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36117>
_______________________________________


More information about the New-bugs-announce mailing list