Perfect hashing for Py

bearophileHUGS at bearophileHUGS at
Fri Jul 11 14:01:12 CEST 2008

Following links from this thread:

I have found this perfect hash (minimal too) implementation:

I have already translated part of it to D, and it seems to work well
enough. As discussed in the PyConDue, I think this may be used in
frozenset (and frozendict) to build a (minimal too?) perfect hash on
the fly, to allow (hopefully) faster retrieval of items that don't
That code is C and I think it's public domain, so if experiments show
it gives enough speed up, it may be added to CPython 2.6/3.


More information about the Python-list mailing list