5 ms·
You can still only have one statement per lambda. And lots of Python's constructs are unfortunately statements and not expressions. The walrus operator moves
by eru 7y ago
You can still only have one statement per lambda. And lots of Python's constructs are unfortunately statements and not expressions.
The walrus operator moves Python closer to the expressions-camp.
In practice, the bigger problem with a more functional Python is that the ubiquitous dicts don't have nice and concise operators for persistent operations. Eg you can concatenate two lists via +, but dicts are more cumbersome.
Though that improved a bit, {dictA, dictB} mostly solves that problem. But more operators would be useful.
And, of course, lack of tail call elimination puts a damper on things. You can mostly work around that problem, but eg implementing state machines as mutually recursive functions is going to be a pain.