[Python-ideas] Inline assignments using "given" clauses

João Santos jmcs at jsantos.eu
Fri May 11 09:47:05 EDT 2018


How do you read something like " while (cmd := get_command()).token !=
CMD_QUIT:" in plain english?

On Fri, 11 May 2018 at 12:15 Jacco van Dorp <j.van.dorp at deonet.nl> wrote:

> 2018-05-11 11:56 GMT+02:00 João Santos <jmcs at jsantos.eu>:
> > Optimizing syntax for space makes sense for "mathematical" notation since
> > it's commonly written by hand, but putting space above readability in a
> > programming language design feels like a skewmorphism.
>
> You are assuming "given" to improve readability, where I stated ":= is
> perfectly clear ", at least in my opinion. Therefore, since clarity is
> already achieved, the rest is clutter that reduces readability.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180511/7a870857/attachment.html>


More information about the Python-ideas mailing list