Hmm... An idea: if a,b==c,d:

Mel Wilson mwilson at the-wire.com
Tue Nov 19 16:48:09 EST 2002


In article <2n7cra.j65.ln at beastie.ix.netcom.com>,
Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
>        But, in a way, it is the COMMA that defines a tuple, not the ()s... We
>recently had a discussion in which it was explained that
>
>a,b = b,a
>
>in essence generates a (b,a) tuple, then unpacks it into the left-side
>a,b

The penny drops!  This is why expressions must not include assignment
operations.

        Thanks.         Mel.



More information about the Python-list mailing list