From a81f68c35c3dc3ef52d46bd58c13f98fb2d8ead8 Mon Sep 17 00:00:00 2001 From: Chris Angelico Date: Fri, 2 Mar 2018 22:26:35 +1100 Subject: [PATCH] PEP 572: Add additional rationale from while loops --- pep-0572.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pep-0572.rst b/pep-0572.rst index 2c524a171..cf8ffb798 100644 --- a/pep-0572.rst +++ b/pep-0572.rst @@ -27,6 +27,11 @@ are currently several ways to spell this, none of which is universally accepted as ideal. A statement-local name allows any subexpression to be temporarily captured and then used multiple times. +Additionally, this syntax can in places be used to remove the need to write an +infinite loop with a ``break`` in it. Capturing part of a ``while`` loop's +condition can improve the clarity of the loop header while still making the +actual value available within the loop body. + Syntax and semantics ====================