Message86692
In all current versions of Python, the str or repr of a float always
includes *either* an exponent, or a decimal point and at least one digit
after the decimal point.
I propose making the str or repr of a complex number behave in the same
way. That is, instead of
>>> 2+4j
(2+4j)
we'd have:
>>> 2+4j
(2.0+4.0j)
The aims are to make complex representation more consistent with float
representation, retain the visual reminder that the pieces of a complex
number are floats (to me, 2+4j looks like a Gaussian integer rather than
a complex number), simplify the implementation a little, and remove the
ugliness where floats switch from normal to exponential notation at
1e11, but complex numbers switch at 1e12.
See
http://mail.python.org/pipermail/python-dev/2009-April/089030.html
for some additional discussion. |
|
Date |
User |
Action |
Args |
2009-04-27 20:45:10 | mark.dickinson | set | recipients:
+ mark.dickinson, eric.smith |
2009-04-27 20:45:08 | mark.dickinson | set | messageid: <1240865108.11.0.174510817411.issue5858@psf.upfronthosting.co.za> |
2009-04-27 20:45:04 | mark.dickinson | link | issue5858 messages |
2009-04-27 20:45:02 | mark.dickinson | create | |
|