python/cpython
View on GitHub ↗ ★ 77,791 Python
The Python programming language
548 mentions on Hacker News by 400 people: 44 stories, 504 comments · first 2014-12-30 · latest 2026-10-27
20082026
-
That sounds like the compilation is accidentally triggering this old frustration [0]. [0] https://github.com/python/cpython/issues/131189
comment by shakna · 2025-09-24 · in Python on the Edge: Fast, sandboxed, and powered by WebAssembly -
Interesting. You're right. Code pointer: https://github.com/python/cpython/blob/main/Objects/unicodeo... Also implies that Animats is correct that including an emoji in a Python string can bloat the memory consumption by a factor of 4.
comment by nostrademons · 2025-09-13 · in UTF-8 is a brilliant design -
In the CPython reference interpreter, that VM can be found at https://github.com/python/cpython/blob/main/Python/ceval.c It's 3619 lines. It's explained in this 515 line file: https://github.com/python/cpython/blob/main/InternalDocs/ For…
comment by jonjacky · 2025-09-04 · in Writing a C compiler in 500 lines of Python (2023) -
…your own ad-hoc system using loop.call_soon_threadsafe() or use third-party libs like Janus[2]. [1] https://github.com/python/cpython/blob/e4e2390a64593b33d6556... [2] https://github.com/aio-libs/janus
comment by xg15 · 2025-09-02 · in Python has had async for 10 years – why isn't it more popular? -
…for children I have always hated that comprehension variables leak for that same reason 1: https://github.com/python/cpython/blob/v3.13.7/Grammar/pytho...
comment by mdaniel · 2025-08-29 · in Python: The Documentary [video] -
…want to behave differently. [1] https://github.com/enthought/Python-2.7.3/blob/master/Lib/Us... [2] https://github.com/python/cpython/issues/105524
comment by quietbritishjim · 2025-08-01 · in A Python dict that can report which keys you did not use -
…it was was fixed in 2018. That's what it took to not write my own date parsing library. [1] https://github.com/python/cpython/issues/60077
comment by Animats · 2025-07-26 · in Never write your own date parsing library -
Python 3.14 adds strptime() https://github.com/python/cpython/issues/41431 "The new constructor is equivalent to datetime(*(time.strptime(date_string, format)[0:6]))."
comment by watersb · 2025-07-24 · in Show HN: Easy Python Time Parsing -
…I've found that the best way to inspect Python programs with GDB is to use the GDB extensions ( https://github.com/python/cpython/blob/3.13/Tools/gdb/libpyt... ) that the CPython project maintains. It's a bunch of code that tells GDB how…
comment by magne_undoio · 2025-07-24 · in Checking Out CPython 3.14's remote debugging protocol -
…idea where anyone got that idea - except for the single actual bug in CPython that is mentioned ( https://github.com/python/cpython/issues/54753 ). I don't feel strongly about Python, but I do think CPython is a great way for people to…
comment by harrisi · 2025-07-19 · in What the Fuck Python -
Nice. Looks like I was looking at an old version of the file. https://github.com/python/cpython/commit/09ba98436444d2a4e11...
comment by cobbal · 2025-07-12 · in '123456' password exposed chats for 64M McDonald's job applicants -
…Come again? def uuid4(): """Generate a random UUID.""" return UUID(bytes=os.urandom(16), version=4) https://github.com/python/cpython/blob/3.13/Lib/uuid.py
comment by shakna · 2025-07-12 · in '123456' password exposed chats for 64M McDonald's job applicants -
…it does not incorporate RFC9110 which renames some status codes which previously were WebDAV-only: https://github.com/python/cpython/pull/117611
comment by roywashere · 2025-07-11 · in Series of posts on HTTP status codes (2018) -
…like you said. If you're interested, it's slowly becoming more like lazy basic block versioning https://github.com/python/cpython/issues/128939 You did great work on YJIT, and I am quite thankful for that.
comment by kenjin4096 · 2025-07-08 · in Reflections on 2 years of CPython's JIT Compiler -
…that reads insane to anyone doing actual work, like the "maintenance burden" of the cgi module: https://github.com/python/cpython/commits/3.12/Lib/cgi.py Turns out most maintenance this thing received is the various attempts of removing it.
comment by stefan_ · 2025-07-06 · in Serving 200M requests per day with a CGI-bin -
https://github.com/python/cpython/blob/847d1c2cb4014f122df64... . i686 is Windows only. I see there's a warning about this later if you're unsupported and therefore a 0 case, but either this becomes an error later on or they softened the…
comment by Neywiny · 2025-06-30 · in Fedora's 32-Bit (I686) Support Withdrawal Postponed – Here's Why -
…https://github.com/mozilla-firefox/firefox https://github.com/torvalds/linux https://github.com/python/cpython
comment by mrkeen · 2025-06-28 · in Uncle Sam wants you – to use memory-safe programming languages -
…so small they put it in a lookup table [2]. It is a strange and very unequal choice for a demo. [1] https://github.com/python/cpython/blob/0d9d48959e050b66cb37a... [2] https://github.com/python/cpython/blob/0d9d48959e050b66cb37a...
comment by mkl · 2025-06-23 · in Python can run Mojo now -
Reported as < https://github.com/python/cpython/issues/135835 >.
comment by jwilk · 2025-06-23 · in Unexpected security footguns in Go's parsers -
…randomize iteration In fact, we see this with CPython `set`, controlled by `_Py_HashSecret`: https://github.com/python/cpython/blob/6eb6c5dbfb528bd07d77b... https://github.com/python/cpython/blob/6eb6c5dbfb528bd07d77b...…
comment by jamesdutc · 2025-06-13 · in Are Python Dictionaries Ordered Data Structures? -
Cool, but looks like it's going to miss capabilities, so not suitable for a full OS backup (see https://github.com/python/cpython/issues/113293 )
comment by ajb · 2025-06-08 · in BorgBackup 2 has no server-side append-only anymore -
…parsers and PEG grammars e.g. https://github.com/llvm/llvm-project/blob/llvmorg-20.1.5/cla... and https://github.com/python/cpython/blob/v3.13.3/Grammar/pytho...
comment by mdaniel · 2025-05-20 · in Don't Use ISO/IEC 14977:1996 Extended Backus-Naur Form (EBNF) (2023) -
…being real ones is just comical. Even the standard library is barely typed, so they give no fucks https://github.com/python/cpython/blob/v3.13.3/Lib/re/__init... What does it accept? Who knows. What does it return? Don't worry about it
comment by mdaniel · 2025-05-17 · in Pyrefly: A new type checker and IDE experience for Python -
…a concrete proposal, it's likely worth shopping around at https://discuss.python.org/c/ideas/6 or https://github.com/python/cpython/issues/ .
comment by zahlman · 2025-05-17 · in The first year of free-threaded Python -
…I can’t decipher either one [1, 2] from the first glance – maybe if I get some more sleep? [1]: https://github.com/python/cpython/blob/3.13/Lib/collections/... [2]: https://github.com/python/cpython/blob/3.13/Lib/typing.py#L2...
comment by notpushkin · 2025-05-16 · in The first year of free-threaded Python -
…we parsing the Python code into an AST? CPython uses a generated parser. The grammar is defined in https://github.com/python/cpython/blob/main/Grammar/python.g... which is used to generate the specification at…
comment by zanie · 2025-05-07 · in Ty: A fast Python type checker and language server -
There is a formal grammar defined in the CPython repo, implemented in a language called ASDL: https://github.com/python/cpython/blob/main/Parser/Python.as... ty uses the same AST and parser as ruff. We don't use the ASDL grammar directly,…
comment by dcreager · 2025-05-07 · in Ty: A fast Python type checker and language server -
…already done all this work. CPython's struct module is just a shim importing the C implementations: https://github.com/python/cpython/blob/main/Lib/struct.py Pypy's is a Python(-ish) implementation, leveraging primitives from its own rlib…
comment by mikepurvis · 2025-04-28 · in Show HN: I built a hardware processor that runs Python -
…and issues with documentation can also be reported on the main Python GitHub issue tracker ( https://github.com/python/cpython/labels/docs ).
comment by zahlman · 2025-04-23 · in Advanced Python Features -
…because it would been a Python 3 str-style debacle if ints and bools were not interchangeable. [0] https://github.com/python/cpython/blob/main/Objects/boolobje...
comment by hermitdev · 2025-04-22 · in Python’s new t-strings -
…the first time I've seen "nonlocal". In the ~100 packages I have installed, I see 0 usages! [1] https://github.com/python/cpython/blob/a6a3dbb7db0516a72c5ef...
comment by nomel · 2025-04-22 · in Python’s new t-strings -
From https://github.com/python/cpython/issues/99108#issue-1436673... : > As evidenced by the recent SHA3 buffer overflow, cryptographic primitives are tricky to implement correctly. There might be issues with memory management, exceeding…
comment by chrisrodrigue · 2025-04-19 · in 15,000 lines of verified cryptography now in Python -
…post) and should be included in all the currently supported versions (>=3.9) of Python [2]. [0] https://github.com/python/cpython/blob/main/Doc/whatsnew/3.1... [1] https://peps.python.org/pep-0745/ [2] https://devguide.python.org/versions/
comment by chrisrodrigue · 2025-04-18 · in 15,000 lines of verified cryptography now in Python -
…tps://github.com/pyca/cryptography/issues/9185 Edit: Found a relevant issue, "closed as not planned": https://github.com/python/cpython/issues/82198
comment by Retr0id · 2025-04-18 · in 15,000 lines of verified cryptography now in Python -
…code for CPU autodetection bear in mind that performance is tricky -- see my comment about NEON https://github.com/python/cpython/pull/119316#issuecomment-2...
comment by protz · 2025-04-18 · in 15,000 lines of verified cryptography now in Python -
More context here. https://github.com/python/cpython/issues/99108#issuecomment-...
comment by jessekv · 2025-04-18 · in 15,000 lines of verified cryptography now in Python -
…bugs and thus greater security assurance. If you look at the original bug that spawned this work ( https://github.com/python/cpython/issues/99108 ), the poster reported: """As evidenced by the recent SHA3 buffer overflow, cryptographic…
comment by otterley · 2025-04-18 · in 15,000 lines of verified cryptography now in Python -
…default implementation of datetime in cpython is a C module (with a fallback to pure python one) https://github.com/python/cpython/blob/main/Modules/_datetim... Not saying it's necessarily justified in case of this library, but if they…
comment by karlicoss · 2025-04-14 · in Whenever: Typed and DST-safe datetimes for Python -
…want to compile multiple versions of Python from source and then make venvs based off of them - see https://github.com/python/cpython/issues/106045 .
comment by zahlman · 2025-04-13 · in How I install personal versions of programs on Unix -
…dispatch first and then end up with a similar sort of int comparison in `long_richcompare`. [2] [1] https://github.com/python/cpython/blob/561965fa5c8314dee5b86... [2] https://github.com/python/cpython/blob/561965fa5c8314dee5b86...
comment by ammar2 · 2025-04-05 · in Is Python Code Sensitive to CPU Caching? (2024) -
…[1] bring any improvement, or does it merely complicate the source? Should it not be removed? [1] https://github.com/python/cpython/pull/128718
comment by delijati · 2025-03-10 · in Performance of the Python 3.14 tail-call interpreter -
Yes, I found a loop performance regression [0] in 3.12 and 3.13. [0]: https://github.com/python/cpython/issues/123540
comment by sgarland · 2025-03-10 · in Performance of the Python 3.14 tail-call interpreter -
If you are curious about how Python's string interning works: https://github.com/python/cpython/blob/main/InternalDocs/str...
comment by jessekv · 2025-03-03 · in The power of interning: making a time series database smaller -
…by default. "why venv install old pip?" re: `python -m ensurepip && python -m pip install -U pip` https://github.com/python/cpython/issues/74813
comment by westurner · 2025-03-02 · in PEP 486 – Make the Python Launcher aware of virtual environments (2015) -
…only understood NULLs correctly when using QUOTE_NOTNULL, which was added to Python just last year: https://github.com/python/cpython/issues/113732 I've also heard of a fun database where the user "Geoffrey" was truncated to "G". I wonder…
comment by threeducks · 2025-02-03 · in Hello, I'm Mr. Null. My Name Makes Me Invisible to Computers (2015) -
…OCaml https://github.com/ocaml/ocaml/blob/trunk/Makefile Python https://github.com/python/cpython/blob/main/Makefile.pre.in Haskell https://github.com/ghc/ghc/blob/master/ghc/Makefile R https://github.com/wch/r-source/blob
comment by dumah · 2025-01-31 · in A better build system for OCaml -
…in its official tooling. 1: https://github.com/google/flatbuffers/blob/master/src/idl_ge... 2: https://github.com/python/cpython/issues/94675
comment by elcritch · 2025-01-29 · in An update on Dart macros and data serialization -
…library; the standard library `ensurepip` (called from `venv`) includes a vendored wheel for Pip ( https://github.com/python/cpython/tree/main/Lib/ensurepip/_b... ), and imports Pip from within that wheel to bootstrap it. (Wheels are zip…
comment by zahlman · 2025-01-13 · in Uv's killer feature is making ad-hoc environments easy -
…the table. So it'll know that 40 is not in the set without having to jump up into `__eq__`**. [1] https://github.com/python/cpython/blob/main/Objects/setobjec... * Note that the actual implementation will place bucket conflicts in the next…
comment by daxfohl · 2025-01-11 · in Why is hash(-1) == hash(-2) in Python? -
…This is in part thanks to algorithmic improvements implemented at least partially in Python ( https://github.com/python/cpython/blob/main/Lib/_pylong.py#L... ). But I can also see improved performance even for only a couple hundred digits…
comment by zahlman · 2025-01-04 · in Can LLMs write better code if you keep asking them to “write better code”?