[issue19210] Unicode Objects in Tuples

Eric V. Smith report at bugs.python.org
Thu Oct 10 13:29:42 CEST 2013


Eric V. Smith added the comment:

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.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19210>
_______________________________________


More information about the Python-bugs-list mailing list