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 eric.smith
Recipients Stephen_Tucker, eric.smith, loewis, peter.otten, pitrou
Date 2013-10-10.11:29:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381404582.43.0.0703034935047.issue19210@psf.upfronthosting.co.za>
In-reply-to
Content
As Martin points out, your first example is printing a string, not a tuple. The parens here are not building a tuple, they are just used for grouping in the expression, and are not doing anything in this example.

So my explanation still holds: everything is working as designed. The output of the first two print statements uses str(astring), the second two use str(atuple).

repr of a tuple is effectively:
"(" + ", ".join(repr(item) for item in tuple) + ")"

So when printing your tuples, Python is using the repr of each string in the tuple.

Since this is not a bug or feature request, it's probably best to continue the discussion on python-list.
History
Date User Action Args
2013-10-10 11:29:42eric.smithsetrecipients: + eric.smith, loewis, peter.otten, pitrou, Stephen_Tucker
2013-10-10 11:29:42eric.smithsetmessageid: <1381404582.43.0.0703034935047.issue19210@psf.upfronthosting.co.za>
2013-10-10 11:29:42eric.smithlinkissue19210 messages
2013-10-10 11:29:42eric.smithcreate