views:

67

answers:

4

Does anyone know good books that discuss the underlying architectures, in-depth analysis of CPython implementation. Something like

  • how list / tuple / dict implemented (and performance comparison...)
  • OOP discussion in Python context

Sorry if it sounds like a silly question :(

+2  A: 

Beautiful Code book has a nice explanation about how dicts are implemented.

Bruno Gola
+2  A: 

This doesn't directly answer your question but it's useful to know nevertheless:

The source code of CPython is well-written and well-documented, and there are some PEPs that shed light on parts of the implementation. You should really try just reading it.

Eli Bendersky
"Use the Source, Luke".
S.Lott
+3  A: 

Python features are described and discussed in Python Enhancement Proposals ("PEPs") These describe the implementation, also PEPs often contain working Python Code to help explain the algorithm though the final implementation may be in C. If you need more details than can be gotten from the PEPs then you should take a look at the source code.

Note: PEPs are written from the perspective of what ever enhancement is being proposed rather than an overall description of the implementation. So for example there might a PEP for Dict-Comprehensions but not for Dicts as a whole. For a top down view of Python internals the source code is the place to go.

Tendayi Mawushe
+2  A: 

You should absolutely, at some point in your Python career, read every word of the Python Data Model and the Python Execution Model. While not CPython-specific, these articles are essential to understanding Python deeply.

Triptych
nice, this is something that I definitely must read :-)
huy