probably weird or stupid newbie dictionary question

hawkmoon269 rson at new.rr.com
Wed Feb 9 10:24:21 EST 2005


I've read in several places that a Python dictionary is analagous to
some other languages' hash table (Perl's, for instance).  But FMU a
dictionary's keys are *themselves* hashed so that a hash table exists
that maps hashed key values to keys in the dictionary.  ISTM, then,
that the analogy is at least somewhat faulty...except for the fact that
a dictionary's keys could themselves be hashed redundantly...i.e., the
values to be used as keys could be hashed, inserted into the dictionary
(and mapped to their values, of course), and they would then be hashed
(again) behind the scenes...IOW, ISTM that a dictionary is correctly
understood generally as a mapping (as documentation indicates) and
*could* be understood as a special case hash table itself...Is that
accurate?

h




More information about the Python-list mailing list