Raymond Hettinger <rhettin...@users.sourceforge.net> added the comment:
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). ---------- nosy: +rhettinger _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7010> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com