if <assignment>:

André Næss andre.hates.spam at ifi.uio.no
Sun Nov 24 08:59:55 EST 2002


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