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 rhettinger
Recipients eric.smith, mark.dickinson, rhettinger, scientist47
Date 2009-09-28.18:14:06
SpamBayes Score 5.372107e-07
Marked as misclassified No
Message-id <1254161648.81.0.240027644246.issue7010@psf.upfronthosting.co.za>
In-reply-to
Content
You're seeing the difference between str(.1) and repr(.1).  When
printing the tuple, you're getting the str of the tuple but just the
repr of its contents ('%.17g').   When printing the number directly,
you're just getting the str of the number which is rounded to fewer
decimal places for display ('%.12g').  

This is easily seen with a number like pi:

>>> from math import *
>>> print(pi)
3.14159265359
>>> print((pi,))
(3.141592653589793,)
>>> repr(pi)
'3.141592653589793'
>>> str(pi)
'3.14159265359'

In Py3.1, the repr computation was changed to show the shortest string
the where float(x)==x.  In the case of .1, the repr and str value happen
to be the same (that is why Eric sees no difference in 3.1).
History
Date User Action Args
2009-09-28 18:14:09rhettingersetrecipients: + rhettinger, mark.dickinson, eric.smith, scientist47
2009-09-28 18:14:08rhettingersetmessageid: <1254161648.81.0.240027644246.issue7010@psf.upfronthosting.co.za>
2009-09-28 18:14:07rhettingerlinkissue7010 messages
2009-09-28 18:14:06rhettingercreate