[Python-ideas] Inline assignment expression
Guido van Rossum
guido at python.org
Sat Mar 14 18:30:43 CET 2009
On Sat, Mar 14, 2009 at 10:15 AM, And Clover <and-dev at doxdesk.com> wrote:
> Jervis Whitley wrote:
>
>> if (something as x) == other:
>> # can now use x.
>
> Interesting. I'd definitely prefer that to the C-style inline assignment
> syntax: I think it reads better, and there's less chance of the Accidental
> Assignment Instead Of Comparison trap that has plagued other languages.
>
> I remain to be convinced that inline assignment is enough of a win in
> general, but if implemented, that's the syntax I'd want.
Perhaps you want to replace top-level assignments with "expr as target" as well?
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-ideas
mailing list