> There's nothing that really technically prevents us from doing an
> assignment as an expression, but Python's language designer decided that
> it encouraged a style of programming that made code harder to maintain.
> By making it a statement, it removes the possiblity of making a mistake
> like:
>
> ###
> if ((ch = getch()) = 'q') { ... }
> ###....hmmm. This doesn't compile. Never mind, I screwed up. *grin* But the Python FAQ does have an entry about this topic, if you're interested: http://python.org/doc/faq/general.html#why-can-t-i-use-an-assignment-in-an-expression _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
