> > >>> x = (2, 3)
> > >>> y = (1, *x)
> >  File "<stdin>", line 1
> > SyntaxError: can use starred expression only as assignment target
>
> But you can already do that without needing to extend * notation
> to work like that

To me the "*" notation already /appears/ to work like that:
(Python 3.x)
    >>> a = [1, 2, 3]
    >>> (b, *c) = a
    >>> b
    1
    >>> c
    [2, 3]

Just only in one direction.

    >>> a = (b, *c)
      File "<stdin>", line 1
    SyntaxError: can use starred expression only as assignment target


Larry
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to