[Python-ideas] Unpacking a dict

Michael Selik michael.selik at gmail.com
Thu May 26 18:14:47 EDT 2016


On Thu, May 26, 2016 at 12:32 PM Sven R. Kunze <srkunze at mail.de> wrote:

> On 25.05.2016 16:06, Ian Foote wrote:
>
> def validate(self, data):
>     {'name': name, 'address': address, **rest} = data
>
> @Michael
> Does using ** instead of * seem more appropriate?
>

It does. ``*args`` creates a tuple. ``**kwargs`` creates a dict.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160526/32383010/attachment.html>


More information about the Python-ideas mailing list