[Python-Dev] performance of {} versus dict(), de fmd(**kw): return kw trumps all ; -)

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Nov 15 23:39:44 CET 2012

Stefan Behnel wrote:
> This should work as long as this still creates a copy of d at some point:
>     d = {...}
>     dict(**d)

It will -- the implementation of the function call opcode always
creates a new keyword dict for passing to the called function.


More information about the Python-Dev mailing list