On Wed, Aug 12, 2015, at 09:57, Scott Sanderson wrote:
> def do_stuff_from_json(json_dict):
> # Assigns variables in the **values** of the lefthand side by doing
> lookups
> # of the corresponding keys in the result of the righthand side
> expression.
> {'foo': foo, 'bar': bar} = json.loads(json_dict)
How about:
key = 'foo'
key2 = 'bar'
{key: value, key2: value2, **rest} = json.loads(json_dict)
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/