3 ms·
I'm no python expert, but if python really has a way to define named functions inside an expression, I'm not sure I want to know how to do it...
by satiric 3y ago
I'm no python expert, but if python really has a way to define named functions inside an expression, I'm not sure I want to know how to do it...
- chii 3y agoi tried a lambda but not sure if it worked, so i gave up
- akdor1154 3y agoWalrus!
- deleted 3y ago[deleted]
- nickcw 3y agoIf you haven't been keeping up with recent Python changes... For Python 3.8, the biggest change is the addition of assignment expressions. Specifically, the := operator gives you a new syntax for assigning variables in the middle of expressions. This operator is colloquially known as the walrus operator. From: https://realpython.com/python-walrus-operator/ https://realpython.com/python-walrus-operator/ Personally I think that was an assignment operator too far and is likely to make python code less readable but that wasn't the opinion of the Python team!
- xigoi 3y agoI tried using the walrus, but it wasn’t accepted.