>On 4 Jun 2013 12:28, "Carlos Nepomuceno" <carlosnepomuc...@outlook.com> wrote:
[...]
>> What's going on? Is there a way to make dict() to resolve the variables?
>Well yes.
>dict(**{a:0,b:1})
>The dict() constructor makes a dictionary from keyword arguments. So you just 
>have to feed it keyword arguments using **.
>And if you're in a bad day,
>dict(**locals())

That's exactly the same!
>>>dict(**{a:0,b:1})=={a:0,b:1}
True

Are there any benefits from using dict() instead of {}?
                                          
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to