dict() vs { } in python which is better? [closed]

Would you believe someone has already analyzed that (from a performance perspective).

With CPython 2.7, using dict() to create dictionaries takes up to 6
times longer and involves more memory allocation operations than the
literal syntax. Use {} to create dictionaries, especially if you are
pre-populating them, unless the literal syntax does not work for your
case.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)