3 ms·
Python already had the “as” and assignment statements so didn’t need three ways to do it. Remember the Zen? (99% of the time walrus is used in “if” or “while”
by mixmastamyk 3y ago
Python already had the “as” and assignment statements so didn’t need three ways to do it. Remember the Zen? (99% of the time walrus is used in “if” or “while” with one expression, which as handles fine.)
Also, along with typing contributes to the excessive “colon blow” of modern Python.
- memefrog 3y agoThere's no 'as' in Python if or while statements, only with. >>> if True as a: File "<stdin>", line 1 if True as a: ^^ SyntaxError: invalid syntax
- mixmastamyk 3y agoIndeed. Coulda been.
- michaelcampbell 3y ago> Remember the Zen? Like Django's "explicit is better than implicit... no, wait, hold my beer" magic.