while expression feature proposal

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Oct 26 20:07:16 EDT 2012


On Fri, 26 Oct 2012 16:48:05 -0600, Ian Kelly wrote:

> On Fri, Oct 26, 2012 at 4:03 PM, Cameron Simpson <cs at zip.com.au> wrote:
>> It will work anywhere an expression is allowed, and superficially
>> doesn't break stuff that exists if "as" has the lowest precedence.
> 
> Please, no.  There is no need for it outside of while expressions, 

There's no need for it *inside* of while expressions. It doesn't add to 
the expressiveness of the language, or increase the power of the 
language, or help people write correct code. It saves one trivial line of 
code in some, but not all, while loops, at the cost of increasing the 
complexity of the language and parser.

-1


> and
> anywhere else it's just going to be bad practice.  Even if it's
> considered an expression, let's only allow it in while expressions.

While loops are not so special. If it will be bad practice elsewhere, it 
will be bad practice in while expressions too.


-- 
Steven



More information about the Python-list mailing list