Comment by TylerE
14 years ago
But, if I remember correctly, the haskell map is typed, isn't it?
In python you can mix the types of both keys and values in a single dict freely.
14 years ago
But, if I remember correctly, the haskell map is typed, isn't it?
In python you can mix the types of both keys and values in a single dict freely.
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?
1 reply →
It's possible in Haskell: