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

random832 at fastmail.us random832 at fastmail.us
Fri Feb 14 23:10:53 CET 2014


On Fri, Feb 14, 2014, at 16:20, Steven D'Aprano wrote:
> -1 on this. Python is not C and should not emulate it's mistakes, no 
> matter how tempting they seem :-)

= as assignment is one of C's mistakes. I propose abandoning it in
Python 4000.

Absent that, assignments as expressions is no longer obviously a
mistake.

Other than the specific syntax, the only difference between this
proposal and assignment expressions is that this proposal also invents a
new form of block scope.


More information about the Python-ideas mailing list