...wrong, and probably also mythical. There's no excuse for having it as a language directive rather than a function call. I don't believe that any human who's spent even a few seconds thinking about it actually prefers the former over the latter.
It's supposed to be a convenient, quick language for scripting. There was no good reason to force some academic consistency on the print call. It's extra keystrokes for no reason. It makes me sick every time I have to use the parentheses.
Yes, you can do the same thing with a kwarg on the print function, but it goes at the end of the line and ends up substantially messier in practice. This is the #1 reason that I still write Python 2 every single day; it makes a huge difference for code generation tasks.
p = partial(print, file=fp)
p("foo")
p("bar")Maybe in Python 4 we can have Nim's approach[1] (allowing both) and another decade of arguing about it.
[1] https://nim-lang.org/docs/manual.html#procedures-command-inv...
I'm not a python dev btw. I've mostly used go/rust/swift where assignment expressions are a big thing so I am a bit biased
FTR, I could care less about the walrus operator.