Are dictionaries the same as hashtables?

Cameron Laird claird at lairds.us
Tue Aug 26 11:48:13 EDT 2008


In article <6hi153Fliuu4U1 at mid.uni-berlin.de>,
Diez B. Roggisch <deets at nospam.web.de> wrote:
>Martin Marcher wrote:
>
>> On 2008-08-26 00:32:20, cnb wrote:
>>> Are dictionaries the same as hashtables?
			.
			.
			.
>Python does not have a "one key maps to a list of values"-semantics - which
>I consider the sane choice...
>
>However, you can have that using the defaultdict for example:
>
>listdict = defaultdict(list)
>
>listdict[key].append(value)
>
>Diez

?  I'm lost.  As I understand your terms, Python's dictionaries
map keys to objects, but you would prefer that Python's 
dictionaries map keys only to lists of values.  That *sounds* 
like a complexification, at best.  Are you trying to make a
point about implementation aligning with semantics?



More information about the Python-list mailing list