In <[EMAIL PROTECTED]> Erik Max Francis <[EMAIL PROTECTED]> writes:

>kj wrote:

>> I just came across an assignment of the form
>> 
>>   x, = y
>> 
>> where y is a string (in case it matters).
>> 
>> 1. What's the meaning of the comma in the LHS of the assignment?

>It's unpacking a 1-tuple:

>       (x,) = y

>The parentheses here are not necessary and are sometimes left out.

I still don't get it.  If we write 

  y  = 'Y'
  x, = y

what's the difference now between x and y?  And if there's no
difference, what's the point of performing such "unpacking"?

TIA!

kynn


-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to