[Python-ideas] return value of yield expressions

H. Krishnan hetchkay at gmail.com
Wed Sep 14 06:53:24 CEST 2011



> My idea was to allow
>
>   *(argument list) = (args, kwds)
>
May be tuple unpacking can be extended to support:
(a,b,c,*args,d,**kwds) = p,q,*a1,r,s,**k1
where "p,q,*a,r,s" is equivalent to itertools.chain((p,q),a,(r,s)) 
(something like scheme's ",@")

And in parallel, function argument unpacking could be extended to support
def func(a,b,c,*args,d,**kwds): pass

But I guess this would not fly:
1. I am not sure about how default values in function arguments would be 
handled
2. PEP 3113 disallows tuple unpacking as part of function arguments
3. Currently, *args is populated with a list (and not tuple) in tuple 
unpacking
and possibly a dozen other issues.

Krishnan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110913/b239df20/attachment.html>


More information about the Python-ideas mailing list