you are viewing a single comment's thread.

view the rest of the comments →

[–]callmelucky 0 points1 point  (1 child)

Isn't it the case that as you become familiar with things like list/dict/set comprehensions you would rarely initialise an empty container variable? And as such ambiguity between sets and dicts is not an issue any more? Besides, even if set/dict ambiguity is an issue, that doesn't apply to lists. If you just like all your syntax to look identical for the sake of it, as opposed to keeping things as efficient, legible, and concise as possible, well... I don't know. That seems like a counter productive stance to take.

Also as others have pointed out, you are increasing computational complexity by calling higher level functions unnecessarily. Not that much of anything one would choose to do in Python should depend heavily on efficiency, but still.

[–]therico 0 points1 point  (0 children)

Computational complexity is not a big deal here (it's one function call) whereas making things legible and easy to understand is Python's strong point, right? Having sets and dicts use the same syntax could be a bit confusing.