[Python-Dev] performance of {} versus dict()

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Nov 14 22:40:48 CET 2012


Chris Angelico wrote:
> Perhaps an alternative question: What can be done to make the latter
> less unpalatable?

* We could introduce a new syntax such as {a = 1, b = 2}.

* If the compiler were allowed to recognise builtins, it could
turn dict(a = 1, b = 2) into {'a':1, 'b':2} automatically.

-- 
Greg


More information about the Python-Dev mailing list