Re: [Python-Dev] Examples for PEP 572

2018年7月04日 11:31:19 -0700

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
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to