On 30/11/2017 15:50, Steven D'Aprano wrote:
> On Wed, Nov 29, 2017 at 07:33:54PM +0000, Steve Barnes wrote:
> 
>> Just a thought but what about a syntax something along the lines of:
>>
>> a, b, *remainder = iterable
>>
>> Where remainder becomes the iterable with the first two values consumed
>> by assigning to a & b.
> 
> Guido's time machine strikes again. That has worked since 3.3 if not
> older. (Probably 3.0 or so, but I don't have that on this computer to
> test it.)
> 
> py> a, b, *remainder = range(10)
> py> a
> 0
> py> b
> 1
> py> remainder
> [2, 3, 4, 5, 6, 7, 8, 9]
> 
> 
> 
> 

I had a sneaky feeling that it did, which raises the question of what 
the bleep this enormous thread is about, since the fundamental syntax 
currently exists....
-- 
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect 
those of my employer.

---
This email has been checked for viruses by AVG.
http://www.avg.com

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to