[issue2292] Missing *-unpacking generalizations

Thomas Wouters report at bugs.python.org
Sat Mar 15 17:14:25 CET 2008


Thomas Wouters <thomas at python.org> added the comment:

On Sat, Mar 15, 2008 at 9:12 AM, Guido van Rossum <report at bugs.python.org>
wrote:

>
> Guido van Rossum <guido at python.org> added the comment:
>
> Didn't you say it does sets too?  Does this work?
> a = [1, 2, 3]
> {1, *a, 0, 4}   # {0, 1, 2, 3, 4}

Yes.

>
>
> How about dicts?
> kwds = {'z': 0, 'w': 12}
> {'x': 1, 'y': 2, **kwds}  # {'x': 1, 'y': 2, 'z': 0, 'w': 12}

Not yet.

>
>
> Also, now that we support
>
> [*a, b, c]
>
> shouldn't we also support
>
> foo(*a, b, c)
>

Sure. (And also 'foo(*a, *b, *c)'?) But have you taken a look lately at the
function definition grammar? I need some time to sort it out :)

Added file: http://bugs.python.org/file9674/unnamed

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2292>
__________________________________
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unnamed
Url: http://mail.python.org/pipermail/python-bugs-list/attachments/20080315/a199ac0e/attachment.txt 


More information about the Python-bugs-list mailing list