<br><br><div class="gmail_quote">On Sat, Mar 15, 2008 at 6:07 PM, Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Thomas Wouters wrote:<br>
> >>> a, b = *c<br>
> File "<stdin>", line 1<br>
> SyntaxError: can use starred expression only as assignment target<br>
<br>
</div>That error message isn't really accurate, since in<br>
<br>
> >>> a, b = (*c,) </blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
the *c is not an assignment target.<br>
</blockquote><div><br>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.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Also, the message implies that<br>
<br>
*c = a, b<br>
<br>
should be valid -- is it?<br>
</blockquote><div><br>No, but that's not related to this patch (but rather the PEP-3132 implementation.)<br></div></div><br>-- <br>Thomas Wouters <<a href="mailto:thomas@python.org">thomas@python.org</a>><br><br>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!