order independent hash?
88888 Dihedral
dihedral88888 at googlemail.com
Fri Dec 2 06:48:17 EST 2011
On Friday, December 2, 2011 5:53:47 PM UTC+8, Hrvoje Niksic wrote:
> Chris Angelico <ros... at gmail.com> writes:
>
> >> The hash can grow with (k,v) pairs accumulated in the run time.
> >> An auto memory management mechanism is required for a hash of a non-fixed size of (k,v) pairs.
> >
> > That's a hash table
>
> In many contexts "hash table" is shortened to "hash" when there is no
> ambiguity. This is especially popular among Perl programmers where the
> equivalent of dict is called a hash.
>
> > Although strictly speaking, isn't that "Python dicts are implemented
> > as hash tables in CPython"? Or is the hashtable implementation
> > mandated?
>
> It's pretty much mandated because of the __hash__ protocol.
A hash table definitely can replace a bi-directional list.
But this is for applications or languages like C.
In python hash is a build in type. Perl's lazy way of programming is famous.
More information about the Python-list
mailing list