Author p-ganssle
Recipients benjamin.peterson, bers, p-ganssle, xtreak
Date 2019-02-26.14:14:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551190456.32.0.306140297986.issue36122@roundup.psfhosted.org>
In-reply-to
Content
Because what's being printed is a tuple, I think it's not exactly the same as issue35417, because in fact this is the correct behavior for 2to3, note that in Python 2:

Python 2.7.15 (default, Jul 21 2018, 11:13:03) 
>>> print 1, 2 
1 2
>>> print(1, 2)
(1, 2)

And in Python 3:

Python 3.7.2 (default, Feb  9 2019, 13:18:43) 
>>> print(1, 2)
1 2
>>> print((1, 2))
(1, 2)

I think this bug report is based on an understandable misunderstanding of what 2to3 does - 2to3 is not intended to be idempotent or to generate code the works for both Python 2 and Python 3, it's intended to translate Python 2 code into Python 3, so passing it something that is *already Python 3 code* you are not guaranteed to get a meaningful output from it.

In this case, it first translates `print 1, 2` (Python 2) into `print(1, 2)` (Python 3), then when you run it a second time, it translates `print(1, 2)` (Python 2) into `print((1, 2))` (Python 3) - in both cases it's doing the right thing.

@bers I hope that this has helped to clarify the situation. Thank you for taking the time to report this.
History
Date User Action Args
2019-02-26 14:14:16p-gansslesetrecipients: + p-ganssle, benjamin.peterson, xtreak, bers
2019-02-26 14:14:16p-gansslesetmessageid: <1551190456.32.0.306140297986.issue36122@roundup.psfhosted.org>
2019-02-26 14:14:16p-gansslelinkissue36122 messages
2019-02-26 14:14:16p-gansslecreate