if <assignment>:

André Næss andre.hates.spam at ifi.uio.no
Sun Nov 24 12:23:30 EST 2002


Mel Wilson wrote:

> In article <arqm0r$s6f$1 at maud.ifi.uio.no>,
> =?ISO-8859-1?Q?Andr=E9_N=E6ss?= <andre.hates.spam at ifi.uio.no> wrote:
>>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 :)
> 
>    We've just been there. groups.google.com can bring it all
> back, although I don't offhand remember the subject.

Ah, thanks, I found the (a?) thread, and it proved an interesting read.

(The subject was: "Conditional Expressions don't solve the problem")

André Næss



More information about the Python-list mailing list