On Mon, Oct 19, 2020 at 19:28 J. Pic <jpic@yourlabs.org> wrote:
+1 because print is a debugging tool mostly used in short lived temporary code as such the parenthesis do not matter and do not provide any value.
A lot of debugger use print to instrumentalize their code during
development or debugging, as in: "I want to dump some variable and run my test again" or something like that. This means that they are writing a line of code that has a lifetime of a few minutes if not seconds. I believe that the parenthesis don't matter in the vast majority of cases where a developer writes a print statement: because they would delete afterwards ie. with git checkout -p or something.
As such, PEP8 would have to decide that parenthesis are the way to go, even though bare print statements are nicer for debugging than parenthesis based debug statements.
-1 Respectfully, I disagree on the facts presented here. print is often not used as a disposable debugging tool. For example, it is sometimes used to write to files other than stdout. On the other hand, assert has no parentheses, and gets committed for posterity everywhere. I confess I haven't really understood the value proposition of having such a distinction between this kind of special statement and any other built in function. I never have, and clearly the early Python makers did, so feel free to discount my arguments as someone who "doesn't get it", but I nevertheless see both print and assert as contrary to some parts of the Zen of Python:
Special cases aren't special enough to break the rules. … There should be one-- and preferably only one --obvious way to do it.