Kevin Wampler <wam### [at] u washington edu> wrote:
> I think any implementation which tries to behave both like a list and a
> hashtable is going to have some inconsistencies when using ints as keys,
> so I actually prefer the approach of keeping the two separate.
Exactly, order shouldn't matter in a dictionary: it's a set. There are lists
if one needs order or you can always base a class on dict and replace
__setitem__ and __getitem__.
What matters in Python though is case and D is not the same as d. :P
PHP and Perl are full of inconsistencies.
Post a reply to this message
|