Is there any reason to prefer dict()
to {}
when initialising an empty dictionary in Python?
Asked
Active
Viewed 66 times
0

jonseymour
- 1,006
- 1
- 12
- 22
-
1nah it's whatever – SuperStew Feb 02 '18 at 05:04
-
1Using literals is faster, but as far as readability is concerned, it's a matter of opinion – juanpa.arrivillaga Feb 02 '18 at 05:06
-
1if you want to treat keys as symbols/atoms at writetime, yes `dict()` is preferable. `dict(a='foo', b='loo')` -)) – marmeladze Feb 02 '18 at 05:08