Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

Would we be willing to consider an enhancement to have complex numbers always 
display using float format rather than ints?

    1+1j --> 1.0+1.0j

We could still suppress an unsigned real zero:

    1j --> 1.0j

but negative zero would show:

    -(1j) --> -0.0-1.0j

I daresay this would break some doctests (CC'ing Tim, as he is a heavy user of 
doctests) but perhaps it would be worthwhile.

Aside from the backwards-compatibility issue, going against this suggestion we 
have the popular Texas Instruments Nspire calculator, which shows complex 
numbers as ints when possible.

On the other hand, the imaginary unit is shown as the symbolic constant i with 
no coefficient, and it also shows complex numbers with an explicit 
multiplication sign: 2⋅i rather than 2i.

Similarly, Julia shows complex numbers with integer coefficients when possible:

https://docs.julialang.org/en/v1/manual/complex-and-rational-numbers/

----------
nosy: +steven.daprano, tim.peters

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to