Minted - Shop now
Buy new:
$39.99
FREE delivery Monday, February 17
Ships from: Amazon.com
Sold by: Amazon.com
$39.99
FREE Returns
FREE delivery Monday, February 17
Or fastest delivery Sunday, February 16. Order within 17 hrs 46 mins
In Stock
$$39.99 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$39.99
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Ships from
Amazon.com
Amazon.com
Ships from
Amazon.com
Sold by
Amazon.com
Amazon.com
Sold by
Amazon.com
Returns
30-day refund/replacement
30-day refund/replacement
This item can be returned in its original condition for a full refund or replacement within 30 days of receipt.
Payment
Secure transaction
Your transaction is secure
We work hard to protect your security and privacy. Our payment security system encrypts your information during transmission. We don’t share your credit card details with third-party sellers, and we don’t sell your information to others. Learn more
$36.00
Item in good condition. Textbooks may not include supplemental items i.e. CDs, access codes etc... Item in good condition. Textbooks may not include supplemental items i.e. CDs, access codes etc... See less
$3.98 delivery February 24 - 25. Details
Only 1 left in stock - order soon.
$$39.99 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$39.99
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Access codes and supplements are not guaranteed with used items.
Ships from and sold by glenthebookseller.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Follow the author

Something went wrong. Please try your request again later.

CPython Internals: Your Guide to the Python 3 Interpreter

4.6 4.6 out of 5 stars 195 ratings

{"desktop_buybox_group_1":[{"displayPrice":"$39.99","priceAmount":39.99,"currencySymbol":"$","integerValue":"39","decimalSeparator":".","fractionalValue":"99","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"K6%2FCyKTLzSmTdPtbBCYlk7YvVSFGE8%2BpNkJfLobYtC68IMYYGoMbCwjJAPyFyq2nVlf3weMYRbPCgfXwJNRyo9VFI7O%2B1rwFAHvHMfmtuFPLwQXppvTqb3iliFvoWcI1vG3L8kBkPMnRU3Ti8YQd1Q%3D%3D","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"$36.00","priceAmount":36.00,"currencySymbol":"$","integerValue":"36","decimalSeparator":".","fractionalValue":"00","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"K6%2FCyKTLzSmTdPtbBCYlk7YvVSFGE8%2BpSdTqY%2BorGITuf7MO7kw3pXCHHRsavuwtM7vAUabvPbmzPTcnLMcBjWO%2BbSfNSWq7xUXOlW5HMeRt7zMBoebvZ5SV3i7XzazdqQp7pts%2FmO%2BwkkrvLJVtSIPKHOndbKSH%2Bj51FvsUA7V56ErMt7hbUX0PrvTsfLQx","locale":"en-US","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}

Purchase options and add-ons

Get your guided tour through the Python 3.9 interpreter: Unlock the inner workings of the Python language, compile the Python interpreter from source code, and participate in the development of CPython.

Are there certain parts of Python that just seem like magic?

This book explains the concepts, ideas, and technicalities of the Python interpreter in an approachable and hands-on fashion.

Once you see how Python works at the interpreter level, you can optimize your applications and fully leverage the power of Python.

By the End of the Book You’ll Be Able To:

  • Read and navigate the CPython 3.9 interpreter source code. You’ll deeply comprehend and appreciate the inner workings of concepts like lists, dictionaries, and generators.
  • Make changes to the Python syntax and compile your own version of CPython, from scratch. You’ll customize the Python core data types with new functionality and run CPython’s automated test suite.
  • Master Python’s memory management capabilities and scale your Python code with parallelism and concurrency.
  • Debug C and Python code like a true professional. Profile and benchmark the performance of your Python code and the runtime.
  • Participate in the development of CPython and know how to contribute to future versions of the Python interpreter and standard library. How great would it feel to give back to the community as a “Python Core Developer?”

With this book you’ll cover the critical concepts behind the internals of CPython and how they work with visual explanations as you go along.

Each page in the book has been carefully laid out with beautiful typography, syntax highlighting for code examples.

About the Author:

Anthony Shaw is a CPython contributor and a PyCon speaker. He has a B.Sc. in Computer Science and over 8 years of experience working with Python. Anthony is also a Fellow of the Python Software Foundation and member of the Open-Source Apache Foundation.

What Python Developers Say About The Book:

“It’s the book that I wish existed years ago when I started my Python journey. [...] After reading this book your skills will grow and you will be able solve even more complex problems that can improve our world.”

— Carol Willing, CPython Core Developer & Member of the CPython Steering Council

“CPython Internals is a great (and unique) resource for anybody looking to take their knowledge of Python to a deeper level.”

— Dan Bader, Author of Python Tricks

“There are a ton of books on Python which teach the language, but I haven’t really come across anything that would go about explaining the internals to those curious minded.”

— Milan Patel, Vice President at (a major investment bank)

“I can recommend CPython Internals to anyone who wants to get going with hacking on CPython.”

— Guido van Rossum, Creator of Python

Frequently bought together

This item: CPython Internals: Your Guide to the Python 3 Interpreter
$39.99
Get it as soon as Monday, Feb 17
In Stock
Ships from and sold by Amazon.com.
+
$28.50
Get it as soon as Monday, Feb 17
In Stock
Ships from and sold by Amazon.com.
+
$39.99
Get it as soon as Monday, Feb 17
Available to ship in 1-2 days
Ships from and sold by Amazon.com.
Total price: $00
To see our price, add these items to your cart.
Details
Added to Cart
spCSRF_Treatment
Some of these items ship sooner than the others.
Choose items to buy together.

Product details

  • Publisher ‏ : ‎ Real Python (realpython.com) (May 5, 2021)
  • Language ‏ : ‎ English
  • Paperback ‏ : ‎ 394 pages
  • ISBN-10 ‏ : ‎ 1775093344
  • ISBN-13 ‏ : ‎ 978-1775093343
  • Item Weight ‏ : ‎ 1.23 pounds
  • Dimensions ‏ : ‎ 6 x 0.89 x 9 inches
  • Customer Reviews:
    4.6 4.6 out of 5 stars 195 ratings

About the author

Follow authors to get new release updates, plus improved recommendations.
Anthony Shaw
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Discover more of the author’s books, see similar authors, read book recommendations and more.

Customer reviews

4.6 out of 5 stars
195 global ratings

Review this product

Share your thoughts with other customers

Customers say

Customers find the book provides a deep dive into Python internals and technical insights. They find it interesting and open to exploration, like chess.

AI-generated from the text of customer reviews

Select to learn more
5 customers mention "Knowledge level"5 positive0 negative

Customers find the book provides basic Python knowledge and technical insights. They say it's a deep dive into the Python interpreter internals and covers how CPython works.

"...to advanced techniques, I can say this book provides the most Python fundamental knowledge to readers...." Read more

"A deep dive into the Python Interpreter internals - learn how to extend the language -..." Read more

"...It did a very good job, for me, of introducing how Python works and thinks as well as open a lot of places to explore and learn more about how and..." Read more

"Well written, interesting, detailed coverage of how CPython works, documenting all the main internal wheels...." Read more

3 customers mention "Interest"3 positive0 negative

Customers find the book interesting and engaging, opening new areas for exploration.

"...me, of introducing how Python works and thinks as well as open a lot of places to explore and learn more about how and why Python works like it does...." Read more

"Well written, interesting, detailed coverage of how CPython works, documenting all the main internal wheels...." Read more

"...I doubt that I will really be able to use that knowledge, but it is interesting in the same way that chess puzzles are fun." Read more

Top reviews from the United States

  • Reviewed in the United States on August 20, 2022
    Like me, if you are curious to learn in depth about Python compilation and execution methodology, this is the perfect book for you.

    Having read 3 other books on Python fundamentals to advanced techniques, I can say this book provides the most Python fundamental knowledge to readers.

    Only thing to keep in mind is that this is not a holistic reference book on Python, so do not expect it to cover about each data structure.
    5 people found this helpful
    Report
  • Reviewed in the United States on September 9, 2022
    A deep dive into the Python Interpreter internals
    - learn how to extend the language
    - understand how source code is transformed into ASTs and bytecode
    - deep dive into custom GIL optimizations
    - some good performance tuning tips
    I learned much from this book.
    One possible improvement would be sequence diagrams describing the various internal code flows - easier to grok.
    2 people found this helpful
    Report
  • Reviewed in the United States on May 19, 2021
    This guide is a very straightforward introduction and dive into the insides of how Python's core interpreter works. It did a very good job, for me, of introducing how Python works and thinks as well as open a lot of places to explore and learn more about how and why Python works like it does. Extremely glad I got this because it unlocked a lot of understanding for me. I still need to read it a few more times to really get my head around it all, but as a tour of the pieces and why they are there and how the work together, this is a very welcome onramp.
    4 people found this helpful
    Report
  • Reviewed in the United States on June 17, 2023
    Well written, interesting, detailed coverage of how CPython works, documenting all the main internal wheels.

    I gave it a 4 because of a very annoying feature of the type - some of the text (strings and comments) is a very pale gray. Reserved words and numbers are also gray although not as pale. Both are very hard to read. They may be nicely colored and highlighted in the digital version. The value of putting them in a different font/color is unclear in such simple B&W examples.

    Amazingly I downloaded the Python source following the directions and it built! My experience with other open source hasn't been so orderly.
  • Reviewed in the United States on August 18, 2021
    Book arrived in good condition. Without any damage
  • Reviewed in the United States on May 17, 2021
    excellent book to better understand python. Highly recommended!!!!
    4 people found this helpful
    Report
  • Reviewed in the United States on May 17, 2021
    Short answer is: I was very impressed by this book because it is well written, focuses on Python 3.9, provides detailed instructions, and the code samples were tested across the three major operating systems: MacOS, Linux and Windows.

    What it is not: If you are only wanting a primer on how to write a "C" extension for Python then this is not what this book is about.

    What this book is: Step-by-step instructions explain how you can setup a "C" compiler (explaining MacOS, Linux and Windows setup separately), pull down the open-source "C" programs from the internet, and compile your own executable version of the enormously popular CPython interpreter. The book goes into great detail about the concepts and purposes behind what that "C" code does under the hood (lexing, parsing, etc). Anthony Shaw's book is aimed more at the very curious Python programmers who want to try out newer versions of the continually evolving CPython... perhaps to someday contribute to that effort, or maybe to insert their own custom fixes or enhancements... without having to wait for the next major release. This book is also aimed at the more serious programmers who are simply curious about what the CPython interpreter actually does internally, to gain an understanding of how Python's dictionary objects defined in the "C" source, and so on.

    This book is written in a clear manner and will open up a new world for those seeking this kind of information! And just in case you're wondering: No, I don't work for the author or RealPython. I'm not being paid a dime for this recommendation.
    --DT
    15 people found this helpful
    Report
  • Reviewed in the United States on May 10, 2021
    This book is the real deal,  a lifetime of entertainment as you explore the bowels of Python.
    Any serious python programmer should consider working through this book. It will keep you
    busy.  The good news is the people who wrote it know what they are talking about and they
    talk to you in a nice way. That makes a lot of difference.  While I am here I should make a plug
    for the realpython.com site. This book along with a lot of other great learning materials are
    available there. Again, nice people who will take you where you're at and help you move
    forward with your python programming skills.
    7 people found this helpful
    Report

Top reviews from other countries

Translate all reviews to English
  • José
    5.0 out of 5 stars Muito bom
    Reviewed in Brazil on July 27, 2024
    Livro em inglês bem direto, explica bem todos os detalhes e sabendo só o inglês técnico já consegue ler e compreender bem os conceitos. Recomendo que tenha um pouco de conhecimento de python e construção de compiladores, para entender os termos como LL e outros.
  • Hjort
    1.0 out of 5 stars Missing index makes an else good book more or less useless
    Reviewed in Sweden on March 30, 2022
    The content of this book is great and is clearly a higher rating than one star. But a technical book without an index is considered incomplete and quite useless as a quick reference.
  • Tudor Plugaru
    5.0 out of 5 stars Well written!
    Reviewed in Germany on June 7, 2021
    This is an excellent book and one that I was looking for. For long, I was planning to looking into how to contribute to CPython, and this book finally made me start.
  • Daniel Dimmick
    5.0 out of 5 stars Writing code is one thing...
    Reviewed in the United Kingdom on May 13, 2021
    knowing the why and the how is quite another
    Customer image
    Daniel Dimmick
    5.0 out of 5 stars
    Writing code is one thing...

    Reviewed in the United Kingdom on May 13, 2021
    knowing the why and the how is quite another
    Images in this review
    Customer image
  • Junejie Ruzol
    5.0 out of 5 stars mishandled by amazon
    Reviewed in Singapore on August 23, 2021
    Customer image
    Junejie Ruzol
    5.0 out of 5 stars
    mishandled by amazon

    Reviewed in Singapore on August 23, 2021

    Images in this review
    Customer image