Which aspects?
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.
...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.
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...
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")I've worked in and around Python for more than a decade, and I've yet to meet a single developer who didn't initially dig their heels in over `print` being changed, and then later realize that they were flat wrong to have dug their heels in because the new way is measurably better.
I mean, I guess I hadn't until today.
python-modernize --write --no-six PROJECT_DIR
(https://python-modernize.readthedocs.io/en/latest/) futurize --write PROJECT_DIR
(https://python-future.org/quickstart.html)old.py:
bs = raw_input()
# Call a 3ps which originally accepts a bytestream, but now accepts a string
some_3rd_party_function(bs)
After python-modernize: from six.moves import input
bs = input()
# Your code using bs as a bytestring still works
# Runtime Error:
# This now accepts a string, and you need to modify your code to deal with random TypeError popping from everywhere
some_3rd_party_function(bs)In both cases, as shown in the linked documentation, these tools are designed to support staged migrations for exactly this reason.
It would be bonkers for print to be a unary operator because it's just a side effect, and so I feel that your point in this situation is correct where it would not be in your other examples.
It's been more than a decade now. I'm almost tempted to think that anyone who hasn't started porting their code simply isn't going to.