Some Python 2.1 ideas

Rainer Deyke root at rainerdeyke.com
Sat Dec 23 12:36:03 EST 2000


"Bob Alexander" <bobalex at home.com> wrote in message
news:mailman.977590932.19335.python-list at python.org...
> New operator: embedded assignment
>
> As C and Java programmers know, it is sometimes more expressive to embed
> assignments inside other expressions. It's my guess that one reason Python
> doesn't support this is to make "=" illegal inside expressions, thus
> avoiding the "=" vs. "==" errors common in C. A response to that objection
> is to use a different token for embedded assignment -- I suggest ":="
since
> it's already familiar to many folks as an assignment operator.

<snip>

> Is there a downside? The only one I can think of is that assignment
targets
> would not always appear at the left end of program lines!

The downside is that it makes Python code less conistent by creating two
ways to do the same thing ('=' and ':=').  Nonetheless, I am very much in
favor.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list