A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2018-July/154304.html below:

[Python-Dev] Examples for PEP 572

[Python-Dev] Examples for PEP 572 [Python-Dev] Examples for PEP 572Rob Cliffe rob.cliffe at btinternet.com
Wed Jul 4 14:20:51 EDT 2018
On 04/07/2018 02:54, Terry Reedy wrote:
>
> The 2-argument form of iter is under-remembered and under-used. The 
> length difference is 8.
>     while (command := input("> ")) != "quit":
>     for command in iter(lambda: input("> "), "quit"):
A general principle that Chris Angelico has repeatedly mention applies 
here:  If you want (as I instinctively would)
     while (command := input("> ")).lower() != "quit":
you can't express that in your iter version.
Regards
Rob Cliffe
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4