this work,
(a, (b[2], c)) = ('big', ('red', 'dog'))<br>but this not
(a, (b[2], c)) += ('big' ('red', 'dog'))<br><br>paul bedaride<br><br><div class="gmail_quote">On Thu, May 29, 2008 at 6:52 AM, <<a href="mailto:allyourcode@gmail.com">allyourcode@gmail.com</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;">Indeed. Thank you, Guido.<br>
<div><div></div><div class="Wj3C7c"><br>
On 5/28/08, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>
> Apart from the missing comma after 'big' this is already supported.<br>
><br>
> The time machine strikes again!<br>
><br>
> --Guido<br>
><br>
> On Wed, May 28, 2008 at 6:23 PM, Daniel Wong <<a href="mailto:allyourcode@gmail.com">allyourcode@gmail.com</a>> wrote:<br>
>> Hi,<br>
>><br>
>> Are there plans for introducing syntax like this:<br>
>><br>
>> (a, (b[2], c)) = ('big' ('red', 'dog'))<br>
>><br>
>> It seems quite doable, because Professor Hillfinger at UC Berkeley<br>
>> created pyth, a dialect of Python, which has this feature. See page 10<br>
>> of the spec he created for his students to implement the language:<br>
>><br>
>> <a href="http://inst.eecs.berkeley.edu/%7Ecs164/sp08/docs/pyth.pdf" target="_blank">http://inst.eecs.berkeley.edu/~cs164/sp08/docs/pyth.pdf</a><br>
>><br>
>> Of course, this idea could also be applied to 'for' constructs (loops,<br>
>> list comprehensions, and generators) where assignments are implicit.<br>
>><br>
>> Parallel looping (esp using zip) is a great use case for this. Here's<br>
>> a case that's come up more than once for me that "structured"<br>
>> assignments would solve really nicely:<br>
>><br>
>> for n, (a, b) in enumerate(list_of_pairs): ...<br>
>><br>
>> Currently, I must do the following instead:<br>
>><br>
>> for n, pair in enumerate(list_of_pairs):<br>
>> a, b = pair<br>
>> ...<br>
>><br>
>> This isn't such a great solution, because there's more indirection<br>
>> with the introduction of an otherwise useless variable; and (less<br>
>> significantly) there's an extra line of code that doesn't actually<br>
>> compute anything.<br>
>><br>
>> Thoughts?<br>
>><br>
>> Daniel<br>
>><br>
>> PS: Sorry if this has already been discussed; I'm new to this list and<br>
>> I didn't see this mentioned in PEP 3099, unless it's covered under the<br>
>> LL(1) clause.<br>
>> _______________________________________________<br>
>> Python-3000 mailing list<br>
>> <a href="mailto:Python-3000@python.org">Python-3000@python.org</a><br>
>> <a href="http://mail.python.org/mailman/listinfo/python-3000" target="_blank">http://mail.python.org/mailman/listinfo/python-3000</a><br>
>> Unsubscribe:<br>
>> <a href="http://mail.python.org/mailman/options/python-3000/guido%40python.org" target="_blank">http://mail.python.org/mailman/options/python-3000/guido%40python.org</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> --Guido van Rossum (home page: <a href="http://www.python.org/%7Eguido/" target="_blank">http://www.python.org/~guido/</a>)<br>
><br>
_______________________________________________<br>
Python-3000 mailing list<br>
<a href="mailto:Python-3000@python.org">Python-3000@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-3000" target="_blank">http://mail.python.org/mailman/listinfo/python-3000</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-3000/paul.bedaride%40gmail.com" target="_blank">http://mail.python.org/mailman/options/python-3000/paul.bedaride%40gmail.com</a><br>
</div></div></blockquote></div><br>