I understand that they are both essentially the same thing. But in terms of creating an empty list or dict, are there any differences?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In terms of speed, it’s no competition for empty lists/dicts:
and for non-empty:
Also, using the bracket notation lets you use list and dictionary comprehensions, which may be reason enough.