Are dictionaries the same as hashtables?

Chris Mellon arkanes at gmail.com
Tue Aug 26 18:59:15 CEST 2008


On Tue, Aug 26, 2008 at 11:12 AM, Fredrik Lundh <fredrik at pythonware.com> wrote:
> Martin Marcher wrote:
>
>>> Are dictionaries the same as hashtables?
>>
>> Yes, but there is nothing in there that does sane collision handling
>> like making a list instead of simply overwriting.
>
> are you sure you know what "collision handling" means in this context?

I think the confusion comes from thinking that dictionaries are
(really) hash tables and thus that things like collision handling are
exposed to the user of the data structure. In this sense, no,
dictionaries are *not* hash tables. They are mappings of keys to
values, and they use hash tables as part of their implementation.



More information about the Python-list mailing list