Reputation: 13
What is the difference between dict, collections.defaultdict, collections.OrderedDict, collectinos.UserDict?
Please help me with examples.
Upvotes: 1
Views: 1447
Reputation: 89
They're basically all dictionnary with different flavor. You can use them as you would with dictionary.
Unfortunatly, I don't know about the last one, but here is the reference
the UserDict.data would be what act as the normal dict, but I don't know which use case would be interested in this...
Let me know if this clarify what you wanted to know. I suggest you see "super considered super!" by Raymond hettinger if you want to see something cool to do with this.
Upvotes: 1