On 2018-05-15 04:32, Tim Peters wrote:
Just noting some real code I typed today where `given` works great if
it allows unpacking syntax, and assignment expressions don't:

     while True:
         head, matched, s = s.partition(sep)
         if not matched:
             break

Using `given`:

      while matched given head, matched, s = s.partition(sep):

Typing "matched " twice still sucks, though;-)

[snip]

If you're using .partition multiple times, you might as well use .split instead!
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to