assignment expression peeve

Paul Rubin http
Wed Oct 15 13:34:46 EDT 2003


Carl Banks <imbosol at aerojockey.invalid> writes:
> The designers of Python believe that assignment expressions are bad
> news 

I'm not sure you're correct about that.  The impression I've gotten
when this subject has come up before is designers are terrified of
someone saying

   if x = y:

when they meant ==, and causing a nuclear meltdown or something.
Using a different operator like "x := y", avoids that problem which is
why I did it that way in the example I gave.  However, with that
problem removed, it's still not considered a done deal.

> (which I agree with),

Well, that's your opinion.

> and they will NEVER make assigments into expressions just to avoid
> this little problem.

There's no way to know that, without first waiting til the end of "never".




More information about the Python-list mailing list