Comment by jrockway
14 years ago
You can easily define your own type that is "everything". But how useful is a dict in python with keys and values of varying types? I've certainly never used one.
14 years ago
You can easily define your own type that is "everything". But how useful is a dict in python with keys and values of varying types? I've certainly never used one.
It's very useful.
Use it like you'd use a bare object in Javascript, as a freeform data container to hold whatever properties you need. A bit like a key-value NoSQL store, actually.
Values, yes, but keys?
Sure, why not. I mean, I can't offhand of a time that I've really used mixed keys, but I also can't come with any compelling reason why it's a bad idea. Ad-hoc data comes up all the time.