list assignment

2006-02-22 Thread Norvell Spearman
ferent than a tuple unpacking assignment: >>> a, b = 1, 2 >>> a, b (1, 2) >>> [a, b] = [1, 2] >>> a, b (1, 2) In both instances the names a and b are both mapped to 1 and 2 so why are there two different forms? Thanks for any answers. -- Norvell Spearman -- http://mail.python.org/mailman/listinfo/python-list

Re: list assignment

2006-02-22 Thread Norvell Spearman
Raymond Hettinger wrote: > It's not different. They are ways of writing the same thing. Lutz and Ascher have tuple and list assignment as separate entries in their assignment statement forms table so I was expecting there to be some difference; thanks for setting me straight. --

Re: list assignment

2006-02-22 Thread Norvell Spearman
Jeffrey Schwab wrote: > TMTOWTDI, after all. :) A bit ironic that that's the official motto of Perl, don't you think? -- Norvell Spearman -- http://mail.python.org/mailman/listinfo/python-list