[Python-ideas] if expensive_computation() as x:

Steven D'Aprano steve at pearwood.info
Fri Feb 14 22:20:14 CET 2014


On Fri, Feb 14, 2014 at 03:31:19PM -0500, random832 at fastmail.us wrote:
> Isn't this whole concept just a way of sneaking in
> assignments-as-expressions? 

Certainly is.

> I'd almost say it would be preferable to
> _actually_ allow assignments as expressions [maybe with an alternate
> operator like := if we're too worried about people making a mistake in a
> condition], 

-1 on this. Python is not C and should not emulate it's mistakes, no 
matter how tempting they seem :-)



-- 
Steven


More information about the Python-ideas mailing list