[Python-3000] Using *a for packing in lists and other places

Thomas Wouters thomas at python.org
Sun Mar 16 15:32:20 CET 2008


On Sat, Mar 15, 2008 at 6:07 PM, Greg Ewing <greg.ewing at canterbury.ac.nz>
wrote:

> Thomas Wouters wrote:
> >  >>> a, b = *c
> >   File "<stdin>", line 1
> > SyntaxError: can use starred expression only as assignment target
>
> That error message isn't really accurate, since in
>
> >  >>> a, b = (*c,)


> the *c is not an assignment target.
>

Dear lord, give me a chance to fix up all the details before you trip over
things like that. I wrote the patch for load-context-star in half a day at
pycon, I didn't bother to update the error message yet.


> Also, the message implies that
>
>   *c = a, b
>
> should be valid -- is it?
>

No, but that's not related to this patch (but rather the PEP-3132
implementation.)

-- 
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20080316/5ea82fc7/attachment.htm 


More information about the Python-3000 mailing list