HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
python
cpython
Python2014–2026
python / cpython

cpython

The Python programming language

400Distinct people
547Mentions
3Explicit recommenders
78.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The Python programming language

GitHub

Where it is used

  • AWS Lambda — AWS Lambda provides a managed runtime and container base image for Python 3.11 that runs on CPython’s interpreter improvements. It uses CPython’s specialization adaptive interpreter features to improve Lambda workloads’ performance. Source
  • abridging clinical conversations using python — “In addition to the above-mentioned instances, we also use Python widely in conjunction with several Google Cloud Platform (GCP) services and to set up other monitoring and debugging tools.” Source
  • 4 more documented examples

What people are saying

I love the description in the draft PR: 'Twas the night before Christmas, when all through the code Not a core dev was merging, not even Guido; The CI was spun on the PRs with…

divbzero used a recommendation phrase. 3 indexed comments match. This is a phrase match, not a verdict.

Favorable Commenters discuss Tim Peters' contributions to CPython, including int-to-str conversion and Timsort. The tone is respectful and appreciative of his technical achievements.

This week’s discussion is favorable. This is not a standing endorsement. Read the supporting reply

Also in these discussions

  • golang/go · linked in 2 of the same discussions
  • nodejs/node · linked in 2 of the same discussions
  • ruby/ruby · linked in 2 of the same discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Favorable

Commenters discuss Tim Peters' contributions to CPython, including int-to-str conversion and Timsort. The tone is respectful and appreciative of his technical achievements.

Supporting reply 1 · Supporting reply 2 · 2 discussions summarized

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

Tim Peters has died direct repository linkDebated

The discussion centers on the death of Python contributor Tim Peters, with widespread tributes to his technical legacy like Timsort and the Zen of Python clashing with heated disagreements over his controversial suspension by the Python Software Foundation. While many users urge focusing solely on his contributions, others argue that ignoring the PSF's handling of his ban is a disservice to his memory and an endorsement of flawed community governance.

189 readable replies · Supporting reply 1 · Supporting reply 2 · Supporting reply 3 · Supporting reply 4
Timsort direct repository link

Read the discussion on HN. A full-thread summary is not available yet.

Adapting CPython for Yk project name in title

Read the discussion on HN. A full-thread summary is not available yet.

Showing the three threads with the most distinct people linking this repo, from 5 threads this week.

Mentions over time

HN mentions by year547 dated mentions

Observed mentions: 2014-12-30 12:04:55 UTC to 2026-10-27 17:34:51 UTC.

0204060802014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 20 mentions; 2 submissions, 18 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 36 mentions; 4 submissions, 32 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 28 mentions; 2 submissions, 26 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 33 mentions; 4 submissions, 29 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 54 mentions; 2 submissions, 52 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 62 mentions; 3 submissions, 59 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 63 mentions; 6 submissions, 57 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 64 mentions; 4 submissions, 60 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 70 mentions; 6 submissions, 64 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 72 mentions; 6 submissions, 66 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 40 mentions; 5 submissions, 35 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC101
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC404
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC20218
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC36432
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC28226
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC33429
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC54252
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC62359
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC63657
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC64460
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC70664
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC72666
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC40535

What Hacker News says

64 sources
> What I wonder is if the current approach, stated as "copy-and-patch auto-generated code for each opcode", can ever reach that point without being replaced by a completely different design along the way. Of course this approach produces a worse code than a full compiler by definition---stencils would be too rigid to be further optimized. A stencil conceptually maps to a single opcode, so the only way to break out of this restriction is to add more opcodes. And there are only so many opcodes and stencils you can prefare. But I think you are thinking too much about a possibility to make Python as fast as, say, C for at least some cases. I believe that it won't happen at all, and the current approach clearly points why. Let's consider a simple CPython opcode named `BINARY_ADD` which has a stack effect of `(a b -- sum)`. Ideally it should ev
Read the rest
entually be compiled down to a fully specialized machine code something like `add rax, r12`, plus some guards. But the actual implementation (`PyNumber_Add` [1]) is far more complex: it may call at most 3 "slot" calls that may add or concatenate arguments, some of them may call back to a Python code. So let's assume that we have done type specialization and arguments are known to be integers. That will result in a single slot call to `PyLong_Add` [2], which again is still complex because CPython has two integer representations. Even when they are both "compact", i.e. at most 31/63 bits long, it may still have to switch to another representation when the resulting sum is no longer compact. So a fully specialized machine code would be only possible when both arguments are known to be integers and compact and have one more spare bit to prevent an overflow. That sounds way more restrictive. [1] https://github.com/python/cpython/blob/36adc79041f4d2764e1da... [2] https://github.com/python/cpython/blob/36adc79041f4d2764e1da... An uncomfortable truth is that all these explanations also almost perfectly apply to JavaScript---the slot resolution would be the `[[ToNumber]]` internal function and multiple representations will be something like V8's Smi. Modern JS engines do exploit most of them, but at the expense of extremely large codebase with tons of potential attack surfaces. It is really expensive to maintain, and people don't really realize that no performant JS engine was ever developed by a small group of developers. You have to cut some corners. In comparison, CPython's approach is essentially inside out. Any JIT implementation will require you to split all those subtasks into small bits that can be either optimized out or baked into a generated machine code. So what if we start with subtasks without thinking about JIT in the first place? This is what a specializing adaptive interpreter [3] did. The current CPython already has two tiers of interpreters, and micro-opcodes can only appear in the second tier. With them we can split larger opcodes into smaller ones, possibly with optimizations, but its performance is limited by the dispatch logic. The copy-and-patch JIT is not as powerful, but it does eliminate the dispatch logic without large design changes and it's a good choice for this purpose. In the best scenario, it will eventually hit the limit of what's possible with copy-and-patch and a full compiler will be required at that point. But until that point (which may never come as well), this approach allows for a long time of incremental improvements without disruption. [3] https://peps.python.org/pep-0659/
In A copy-and-patch JIT compiler for CPython
Your "just in case the software is exposed to the web" should be "exposed to untrusted data." The very old Python hash could be DoS'ed reading a data file. The original randomized version required some feedback to figure out the hash, so generally required some sort of interaction. I find that hard to believe that's a performance bottleneck. String hashes are all cached, and names like "print" are interned. For a 2x overall gain I would expect to see the hash function pop up easily in my profiling, but I haven't seen it in my own profiling which was looking for simple things like that. When siphash was evaluated, quoting https://peps.python.org/pep-0456/#performance , "In general the PEP 456 code with SipHash24 is about as fast as the old code with FNV" and "The summarized total runtime of the benchmark is within 1% of the runtime of an u
Read the rest
nmodified Python 3.4 binary". Since then they switched from siphash24 to the faster siphash13. https://github.com/python/cpython/pull/28752
In How many lines of C it takes to execute a + b in Python
You can look at the history of PyObject yourself: https://github.com/python/cpython/commits/main/Include/objec.... None of these changes were done because of weird CPU errata that meant that making the header bigger was a performance win. That isn't to say that the developers wouldn't be interested in such effects, or be able to detect them, but the fact that the object header happens to be large enough to avoid the performance bug isn't because of careful testing but because that's what they ended up for other reasons, far before Zen 3 was ever released. If it so happened that Python was affected because the offset needed to avoid a penalty was 0x50 or something then I am sure they would take it up with AMD rather than being content to increase the size of their header for no reason.
In Rust std fs slower than Python? No, it's hardware
> Can I now trust modern python installations to have native-json enabled sqlite built in? There is no absolute guarantee because distros can use any supported SQLite version to build Python (though Debian [1] and thus Ubuntu has long enabled -DSQLITE_ENABLE_JSON1), but you can expect that any Python version released shortly after 2022-03-16 [2] supports JSON functions in the Windows and macOS builds. [1] https://sources.debian.org/src/sqlite3/3.16.2-5%2Bdeb9u1/deb... [2] https://github.com/python/cpython/pull/31655
In Antirez' tiny JSON selector library
> Python doesn't work well with file names in principle: it wants everything to be Unicode. That works for many, but if you want reliable code... you just have to throw all of that away. Windows' APIs use UTF-16 and most file name encodings on Linux are UTF-8. How should Python handle this better? > Also, in case of pathlib, it adds no value on top of os.path of which it is a wrapper. Completely disagree. os.path is annoying to use. Treating paths as objects with methods and joining them with / makes my life much easier. > increasing the size and memory footprint of "standard" library By a ridiculous amount. pathlib is just another pure Python module with a bunch of simple functions and classes. [1] > complicating dispatch and therefore debugging You can simply declare and accept `Union[str, os.PathLike]` and convert the paths to whatever
Read the rest
you want at the entrypoints, then use that in your own project. Where is the complexity? I've never seen this make debugging harder, it's just an additional type. [1] https://github.com/python/cpython/blob/d9fc15222e96942e30ea8...
In Writing and linting Python at scale
You're right, there actually are more. Interesting, I "feel" the opposite. Haskell (55 + some more, because of the grouping): https://wiki.haskell.org/Keywords F# https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref... OCaml: https://v2.ocaml.org/manual/lex.html#sss:keywords Python: https://github.com/python/cpython/blob/3.12/Lib/keyword.py Java (I think these are the current ones): https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_k...
In Roc – A fast, friendly, functional language
I was recently working with stock data from a Django shop, half of their Unix timestamps were correct timestamps, the other half had a local timezone offset baked right into the integer. At least this time finding problematic code will be a grep away, so I'm ok with this change, even though I've used it a lot. Edit: Wow. So Paul Ganssle writes in April "Previously, we have documented that utcnow and utcfromtimestamp should not be used , but we didn’t go so far as to actually deprecate them [...]" The linked to issue where this was decided is from Jul-Sep 2019. And I've never heard about this. Obviously this is my fault, but: where do I need to inform myself to know about these decisions? I've been "happily" using them all the time (quoted because we're all aware of the challenges these conversions pose each and every time). [0] https://gi
Read the rest
In datetime.utcnow() is now deprecated

Showing the 15 most recent of 64 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.