Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



There'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


Indeed. Coulda been.


> Remember the Zen?

Like Django's "explicit is better than implicit... no, wait, hold my beer" magic.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: