But now if our big paint point is assigning a variable to len(), then in two lines evaluating that variable and printing it out, Python is just trying to find stuff to add.
I miss the size and simplicity of old Python. :/
- Complex is better than complicated.
Using the walrus operator makes the code more complex, but less complicated.
Reference: https://www.python.org/dev/peps/pep-0572/#scope-of-the-targe...
> Simple is better than complex.
I understand that nobody will force me to use this feature, but as I said before, even the spec and the write up tells how this feature is confusing and .. complex.
I know and I believe there is a purpose to be exactly after that line. Writing only simple code is not enough. If you write everything in a simple manner your code will most likely be complicated, that's exactly why you have next - complex is better than complicated.
I see this feature the same way as comprehensions, scary and complex at first, but once you learn it you would wish anyone would use it.
https://www.python.org/dev/peps/pep-0572/#differences-betwee...
https://www.python.org/dev/peps/pep-0572/#relative-precedenc...
Even examples of the spec shows how unintuitive and "unpythonic" this is. Explicit is better than implicit.
IMHO adding features to the language to save 1 line of code for 10% of cases when you need it (I agree that there's occasional case when walrus will save you more than 1 line) is just bloat.
I am not a big proponent of Go, because it has its own flaws, though language is indeed very simple and creators of the language try to leave it simple.
IMO Python was very readable, super simple, intuitive and should stay that way, though recent releases show that Python is giving in for the feature bloat.
EDIT:
> Try to limit use of the walrus operator to clean cases that reduce complexity and improve readability.
Facepalm.