Python's Dictionary Implementation: Being All Things to All People > Conclusion

18.6. Conclusion

Despite the many features and options presented by Python dictionaries, and their widespread use internally, the CPython implementation is still mostly straightforward. The optimizations that have been done are largely algorithmic, and their effects on collision rates and on benchmarks have been tested experimentally where possible. To learn more about the dictionary implementation, the source code is your best guide. First, read the Objects/dictnotes.txt file at http://svn.python.org/view/python/trunk/Objects/dictnotes.txt?view=markup for a discussion of the common use cases for dictionaries and of various possible optimizations. (Not all the approaches described in the file are used in the current code.) Next, read the Objects/dictobject.c source file at http://svn.python.org/view/python/trunk/Objects/dictobject.c?view=markup.

You can get a good understanding of the issues by reading the comments and taking an occasional clarifying glance at the code.