3 ms·
True, that, behavior-wise. It's the comma that actually defines the tuple, though, hence (1) being different than (1,) and x = 1,2 assigning (1,2). In the part
by geoelectric 10y ago
True, that, behavior-wise. It's the comma that actually defines the tuple, though, hence (1) being different than (1,) and x = 1,2 assigning (1,2).
In the particular case of a print statement, the grouping parens disambiguate between the comma meaning multiple args and a single arg that's a tuple, once Python 2 implicitly wraps the entire right side with function calling parens.
In the end it's really a form of operator precedence. The from __future__ version behaves differently only because the function calling parens are now explicit and so tuple grouping parens must be added too if desired.