Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's the smiley for?

    Python 2.6.5...
    Type "help", "copyright", "credits" or "license" for more information.
    >>> (a, (b, c, (d, e))) = (1, (2, 3, (4, 5)))
    >>> a, b, c, d, e
    (1, 2, 3, 4, 5)
    >>> (a, (b, c, (d, e))) = (1, (2, 3, (4, 5, 6)))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ValueError: too many values to unpack
It isn't quite as flexible as functional languages and it's not as idiomatic as it is in functional languages, but it's not a hack or quirky edge-case either.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: