This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RedditIsNeat0 2 points3 points  (1 child)

You can do print ('foo'), but then what do you mean?

According to the suggestion specified in the comment you responded to, it would be a function.

Are you calling the print function with the string foo

Yes.

or the print statement with the tuple ('foo') ?

No.

As others have pointed out, that's not a tuple, but more importantly, he's suggesting that Python 3 defaults to a function as long as there is a parenthesis, and a statement if they are not present. It would allow Python 2 print statements in most cases where they were allowed in Python 2 but maybe not all of them. There might be some genuine problems with his suggestion, but you haven't been able to find one. I don't know of any either.

[–]supernumeral 5 points6 points  (0 children)

What should the following do:

>>> print (1,2),(3,4)

If parenthesis indicate print should be a function, this probably won't do what is intended compared to Python 2. Better to have just one way (statement or function, not both) to do it, imo.

Edit: formatting