kj <[EMAIL PROTECTED]> wrote:

> 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"?

None whatsoever when the string has only one character, but with 2 
characters it becomes an obfuscated way of checking that there was only one 
character:

>>> x, = 'a'
>>> x, = 'ab'

Traceback (most recent call last):
  File "<pyshell#29>", line 1, in <module>
    x, = 'ab'
ValueError: too many values to unpack
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to