dict literals vs dict(**kwds)

George Sakkis george.sakkis at gmail.com
Tue May 23 17:39:39 CEST 2006


Although I consider dict(**kwds) as one of the few unfortunate design
choices in python since it prevents the future addition of useful
keyword arguments (e.g a default value or an orderby function), I've
been finding myself lately using it sometimes instead of dict literals,
for no particular reason. Is there any coding style consensus on when
should dict literals be preferred over dict(**kwds) and vice versa ?

George




More information about the Python-list mailing list