I'm curious about the implementation of dictionary in python. I'm learning about hash tables in my computer science course, and I'm aware that the dictionary data structure in python works as a hash table.
What I haven't worked out is this: what determines the number of buckets in the hash table? I'm asking this about python dictionary in particular, although I'd be interested in other cases as well.
Thanks,
Erik
I don't have a link at the moment, but I vaguely remember some Python core contributors doing deep dives into code on video quite a while back. That may not be helpful. 🤷🏽♂️ I'll see if I can find it.
Meanwhile, the docs have this to say: docs.python.org/2/faq/design.html#...
And the follow-up might have some more info: docs.python.org/2/faq/design.html#...
Here's a stackOverflow answer that, if not fully answering your question, will probably at least give you enough leads to get the answers you're looking for: stackoverflow.com/a/9022835/26196
👆🏽👆🏽👆🏽 That SO post actually links to Python source code, which is obviously the "one true" answer about it's implementation, if you are so inclined do dig in in such a way =)