[Python-ideas] dict.hash - optimized per module

Jan Koprowski jan.koprowski at gmail.com
Sun Oct 17 09:27:37 CEST 2010


  My name is Jan and this is my first post on this group. So hello :)
  I'm very sorry if my idea is so naive as to be ridiculous but I
believe it is worth to ask.
  I'm just watched "The Mighty Dictionary" video conference from
Atlanta deliver by Brandon Craig Rhodes.
  After watching I made graph, using presented at conference library
dictinfo, for __builtin__.__dict__.
  When I saw few collisions I think "Why this module doesn't have
their own hashing function implementation which allow to avoid
collision in this set of names?". My second think was "Why each Python
module doesn't have their own internal hashing function which doesn't
produce collisions in scope of his names". Maybe my thoughts was silly
but is this doesn't speed Python a little? I'm aware that this doesn't
work for locals or globals dict but may be an improvement in places
where set of names is constant or predictable like builtins Python
modules. What do You think?

Greetings from Poland,
><> Jan Koprowski

More information about the Python-ideas mailing list