if <assignment>:

Steve Holden sholden at holdenweb.com
Mon Nov 25 10:37:18 EST 2002


Interesting that none of the responders referenced a FAQ article ... though
since it refers to 2.0 as a future release it's clearly in some need of
updating!

    http://www.python.org/cgi-bin/faqw.py?req=show&file=faq06.030.htp

regards
-----------------------------------------------------------------------
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Previous .sig file retired to                    www.homeforoldsigs.com
-----------------------------------------------------------------------
"André Næss" <andre.hates.spam at ifi.uio.no> wrote in message
news:arqm0r$s6f$1 at maud.ifi.uio.no...
> When I started learning Python one of the things that surprised me was
that
> you couldn't do assignments inside the if clause, e.g.:
>
> if myvar = someFunction():
>
> My question is, what is the rationale for this? Is it a technical issue?
Or
> purely a matter of language design? I'm curious because I'm interested in
> the design og programming languages, not because I want this behavior
> changed in Pyton :)
>
> Thanks.
> André Næss
>
>
>






More information about the Python-list mailing list