[Tutor] Creating a dictionary

Válas Péter sulinet at postafiok.hu
Fri May 27 16:47:58 CEST 2011


2011/5/27 Steven D'Aprano <steve at pearwood.info>

> Never put a lone dict literal {...} inside a call to dict(), that's just a
> waste of time. Just use the literal on its own.
>
That's what I thought about this, I just didn't want to believe that
docs.python.org wrote a redundant example.


> third_dict = dict(first_dict, three=3, four=4)
>
> Thank you, these were useful examples!

P.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110527/cf5f370d/attachment.html>


More information about the Tutor mailing list