This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients eric.smith, mark.dickinson
Date 2009-04-27.20:45:02
SpamBayes Score 2.6032372e-09
Marked as misclassified No
Message-id <1240865108.11.0.174510817411.issue5858@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-04-27 20:45:10mark.dickinsonsetrecipients: + mark.dickinson, eric.smith
2009-04-27 20:45:08mark.dickinsonsetmessageid: <1240865108.11.0.174510817411.issue5858@psf.upfronthosting.co.za>
2009-04-27 20:45:04mark.dickinsonlinkissue5858 messages
2009-04-27 20:45:02mark.dickinsoncreate