[issue13746] ast.Tuple's have an inconsistent "col_offset" value

Georg Brandl report at bugs.python.org
Fri Jan 13 20:47:04 CET 2012


Georg Brandl <georg at python.org> added the comment:

This is because the parentheses don't really belong to the tuple literal.

You could just as well write

b = 1, 3.14, 'abc', u'XYZ'

In other cases, the parentheses may be needed for grouping purposes (e.g. in function calls), but they still are only for grouping, just as in (a + b) * c.

For the empty tuple, where the parentheses actually are part of the literal, the col_offset is correct.

----------
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

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


More information about the Python-bugs-list mailing list