[Python-ideas] Statements vs Expressions... why?

Mathias Panzenböck grosser.meister.morti at gmx.net
Sat Sep 13 20:39:14 CEST 2008


Arnaud Delobelle schrieb:
>
> So what does:
>
> a = (if False: 1)
>
> evaluate to?
>

OT: I attended a lecture called "abstract machines" and we had to write a little
VM (parser, bytecode interpreter) on paper during the test. It was a expression
based language and there was a "if ... then ... else ..." AND a "if ... then
..." construct. I asked the Prof. exactly the same question you did. He said:
"Oh... well... strike that out."
He really didn't notice that this is a problem when he wrote the test. *g* :P

(Sorry, for the noise.)

	-panzi



More information about the Python-ideas mailing list