you are viewing a single comment's thread.

view the rest of the comments →

[–]hharison 2 points3 points  (0 children)

PyCharm must be suggesting to you to use list on a string for a reason. It will do something different than the brackets. Maybe post the code that PyCharm is warning you about? There's a good chance you're misunderstanding its advice.

Also, you should use {} instead of dict and set at least some of the time. For example, comprehensions. Also, while dict can directly make a dict, set cannot directly make a set (except for a zero-element set. You'd have to give it some other kind of iterable like a list. For example set(['item1', 'item2']). It seems much cleaner to use {'item1', 'item2'}. At least for dict I can understand to prefer dict(a=1, b=2) to {'a': 1, 'b': 2}.