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

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Mar 16 02:07:36 CET 2008


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.
Also, the message implies that
 *c = a, b
should be valid -- is it?
-- 
Greg


More information about the Python-3000 mailing list

AltStyle によって変換されたページ (->オリジナル) /