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
-
…have been a right call), and the PEP (if not withdrawn) was the way to exercise that control. [1] https://github.com/python/cpython/pull/113465#issuecomment-1...
comment by adrian17 · 2026-10-27 · in Python's experimental JIT to be removed -
…pip because the built-in `ssl` module has been patched to reject it. The relevant commit is https://github.com/python/cpython/commit/7dd8b4736a1419750b9... , featuring a rather amusing workaround for security scanners that might mistake…
comment by zahlman · 2026-10-27 · in Broccoli2Shell: Brotli decoder RCE in Node.js, Python and more -
…to preserve ordering: if timestamp_ms < _last_timestamp_v7: timestamp_ms = _last_timestamp_v7 + 1 https://github.com/python/cpython/blob/8d119208074fef0f652f1... But if you did want "monotonically increasing IDs", as the article suggests,…
comment by nitwit005 · 2026-10-23 · in UUIDv7: Timestamps aren’t time-ordered and other oddities -
…all the bugs autonomously? When is that going to happen? https://github.com/rust-lang/rust/issues https://github.com/python/cpython/issues What about new features? In every thread about Rust, people are clamoring for new features and…
comment by chubot · 2026-10-12 · in The gap in shared understanding of LLM capability is widening -
…you know better and PGO isn't very suitable for "configurable" code. 8. Computed goto. See https://github.com/python/cpython/issues/128563 , who doesn't like 10% free performance? 9. Exploiting uninitialised memory for classic party tricks…
comment by Pannoniae · 2026-10-05 · in Beating the compiler (2024) -
…terrible in terms of performance [...] I'm trying to fix at least brew's Python performance a bit: https://github.com/python/cpython/issues/158283
comment by eru · 2026-10-04 · in Turn off Apple Intelligence on macOS 27 and get its disk space back -
It was never possible to sum() strings. https://github.com/python/cpython/commit/a70b19147fd163744be...
comment by vhcr · 2026-09-17 · in Anecdotally, programmers dislike "reduce" -
…found many bugs, but it also wasn't just recompile on a new platform. We've seen test failures like https://github.com/python/cpython/issues/151040 And perf support needs to be tested and merged https://github.com/python/cpython/issues/1212…
comment by emmatyping · 2026-08-30 · in RISC-V is now officially supported by CPython -
There is a Configure type subsystem, so you'll see stuff like this: https://github.com/python/cpython/pull/156277/changes#diff-4...
comment by tyingq · 2026-08-30 · in RISC-V is now officially supported by CPython -
…use (yet?) but cpython does internally contain an implementation of the HAMT data structure: https://github.com/python/cpython/blob/main/Python/hamt.c Set/Delete/Lookup are all O(log(n)) See also: https://github.com/MagicStack/immutables…
comment by Retr0id · 2026-08-29 · in Time complexity of operations on Python's built-in types -
…the hesitancy to implement this sort of improvement is rather irritating to me. See also https://github.com/python/cpython/issues/90716 .) By the way, `x in range(n)` is only optimized for integer `x`. Not for nonconvertible types (where…
comment by zahlman · 2026-08-29 · in Time complexity of operations on Python's built-in types -
Because the use case is very niche and nobody optimized it yet. https://github.com/python/cpython/issues/135824#issuecomment... `x in range(n)` is already optimized, but that was easier since the `__contains__` method already existed, but…
comment by gpugreg · 2026-08-29 · in Time complexity of operations on Python's built-in types -
…modified the implementemention of str.lower(). That would be bonkers, but that's not what they did. https://github.com/python/cpython/commit/7e109d084d55e7eb The important part is: # B.3 is mostly Python's .lower, except for a number # of…
comment by jwilk · 2026-08-26 · in When str.lower() is a security vulnerability in Python -
…write up. Took me down some rabbit holes, but interesting to see the chatter about the fix here: https://github.com/python/cpython/issues/80233 Initially you could reassign True,False but that was verboten with the switch to python 3! The…
comment by persedes · 2026-08-26 · in Python's pre-declared constants are kinda weird -
…have agreed with this, and then they did the `pathlib.Path` bit of cuteness with the `/` operator: https://github.com/python/cpython/blob/5afbb60e0283caaf34990... And despite my misgivings, it’s really ergonomic.
comment by vtbassmatt · 2026-07-26 · in Some more things about Django I've been enjoying -
To be fair, https://github.com/python/cpython has over 5k open github issues, and that's still generally considered fairly reliably technology even if a lot of HN users seem to hate it.
comment by zahlman · 2026-07-20 · in Claude Code uses Bun written in Rust now -
…space .. but a worst-case that can reliably be triggered with chosen input! recent example: https://github.com/python/cpython/issues/149079
comment by edelbitter · 2026-07-09 · in Unicode's transliteration rules are Turing-complete -
…such as in Python, despite that the DOM API is in the Python standard library since forever (see https://github.com/python/cpython/blob/3.14/Lib/xml/dom/mini... for example).
comment by kccqzy · 2026-07-05 · in Do you hate XML? (2010) -
…interpreter, with Clang's __attribute__((preserve_none)) ABI, just like Python did recently: https://github.com/python/cpython/issues/128563
comment by Koromix · 2026-06-24 · in Performance improvements in libffi -
…mixing sync and async code. [1] https://pypi.org/project/nest-asyncio/ As explained by Guido: https://github.com/python/cpython/issues/66435#issuecomment-...
comment by enragedcacti · 2026-05-26 · in What color is your function? (2015) -
The Python core team seems to think it's unlikely that anyone's relying on the existing behavior: https://github.com/python/cpython/pull/136212#issuecomment-4...
comment by ameliaquining · 2026-05-21 · in Python 3.15: features that didn't make the headlines -
If I understand correctly, this is one of the changes that caused the regression: https://github.com/python/cpython/pull/117120
comment by emil-lp · 2026-05-13 · in Reverting the incremental GC in Python 3.14 and 3.15 -
See the implementation of Python's math.isclose https://github.com/python/cpython/blob/d61fcf834d197f0113a6a...
comment by lukax · 2026-04-18 · in It's OK to compare floating-points for equality -
…inspired by Trio's nurseries[2]. [1] https://docs.python.org/3/library/asyncio-task.html#id6 [2] https://github.com/python/cpython/issues/90908
comment by maleldil · 2026-03-26 · in Looking at Unity made me understand the point of C++ coroutines -
…library for Python started in 2011 [2], but the stdlib library hasn’t seen many improvements. [0] https://github.com/python/cpython/blob/6d7e47b8ea1b8cf82927d... [1] https://learn.microsoft.com/en-us/dotnet/api/system.net.webr... [2]…
comment by Kwpolska · 2026-03-25 · in Why I forked httpx -
Update: I put up a PR to document the trace recording interpreter https://github.com/python/cpython/pull/146110
comment by kenjin4096 · 2026-03-18 · in Python 3.15's JIT is now back on track -
If you change this you break a common optimization: https://github.com/python/cpython/blob/3.14/Lib/json/encoder... Default value is evaluated once, and accessing parameter is much cheaper than global
comment by exyi · 2026-03-18 · in Python 3.15's JIT is now back on track -
…is first called and reused thereafter. You can check the exact code I'm talking about here: https://github.com/python/cpython/blob/main/Objects/unicodeo... Is it clear enough?
comment by cloudbonsai · 2026-03-18 · in Python 3.15's JIT is now back on track -
…https://github.com/tormol/udplite https://github.com/nplab/packetdrill https://github.com/python/cpython/blob/4e96282ee42ab51cf325b... https://github.com/search?q=repo%3Aviveris%2Frohc%20udplite&...
comment by 201984 · 2026-03-16 · in Linux 7.1 to Retire UDP-Lite – Allows for Better Performance with Cleansed Code -
…news. Python 3.15 adapts Pypy tracing approach to JIT and there are real performance gains now: https://github.com/python/cpython/issues/139109 https://doesjitgobrrr.com/?goals=5,10
comment by Ralfp · 2026-03-14 · in Python: The Optimization Ladder -
Yes. The CPython hash algorithm for floats ( https://github.com/python/cpython/blob/main/Python/pyhash.c#... ) special-cases the non-finite values: floating-point infinities hash to special values modeled on the digits of pi (seriously!…
comment by zahlman · 2026-03-12 · in NaN Is Weird -
…concern anymore. Moreover, I have used PyPy for years to beat the pants off CPython programs. [1] https://github.com/python/cpython
comment by paulddraper · 2026-03-08 · in Warn about PyPy being unmaintained -
…So in CI/CD you can replace all discrete lint/format tool calls with one to pre-commit/prek. E.g. https://github.com/python/cpython/blob/main/.github/workflow... .
comment by forgotpwd16 · 2026-02-03 · in Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust -
…Python/cpython//InternalDocs/README.md > "CPython Internals Documentation": https://github.com/python/cpython/blob/main/InternalDocs/REA...
comment by westurner · 2026-01-31 · in CPython Internals Explained -
…release. It's fairly buried in the "What's New" document, but apparently the original issue is at https://github.com/python/cpython/issues/130704 and corresponding PR https://github.com/python/cpython/pull/130708 .
comment by zahlman · 2026-01-04 · in Recent Optimizations in Python's Reference Counting -
…negatively affect other compilers. [1]: https://github.com/faster-cpython/ideas/issues/183 [2]: https://github.com/python/cpython/issues/121263
comment by kenjin4096 · 2025-12-25 · in Python 3.15’s interpreter for Windows x86-64 should hopefully be 15% faster -
…__attribute__((musttail)) # define Py_PRESERVE_NONE_CC __attribute__((preserve_none)) # endif https://github.com/python/cpython/pull/143068/files#diff-45b... Apparently(?) this also needs to be attached to the function declarator and does…
comment by mananaysiempre · 2025-12-25 · in Python 3.15’s interpreter for Windows x86-64 should hopefully be 15% faster -
Here's the relevant diff: https://github.com/python/cpython/pull/137968/files#diff-966... Search is limited to 20 attributes and non-descriptors only to avoid arbitrary code execution. I assume constructing AttributeErrors isn't highly…
comment by edflsafoiewq · 2025-12-21 · in What's New in Python 3.15 -
…the folder into the actual release notes. Python and many other large projects handle it like this: https://github.com/python/cpython/tree/main/Misc/NEWS.d/next (The release notes for major releases are crafted manually) On the other hand,…
comment by formerly_proven · 2025-12-13 · in Ask HN: How do you handle release notes for multiple audiences? -
…useless to them; but nobody seems to care about that sort of thing any more, much to my chagrin.) https://github.com/python/cpython/issues/83534
comment by zahlman · 2025-11-29 · in System 7 natively boots on the Mac mini G4 -
Sure, all software is terrible if looking at bug frequency history... https://github.com/python/cpython/issues Griefers ranting about years old _closed_ tickets on v1.0.5 versions on a blog as some sort of proof of lameness... is a poorly…
comment by Joel_Mckay · 2025-11-26 · in Python is not a great language for data science -
…date. There is some discussion whether or not to add helpers for this to Python‘s uuid7 module: https://github.com/python/cpython/issues/130843#issuecomment...
comment by sscherfke · 2025-11-15 · in How to Use UUIDv7 in Python, Django and PostgreSQL -
…object being method-called on and the method, there’s sometimes one less PyObject for the binding: https://github.com/python/cpython/issues/70298 , with additional/somewhat related info in PEP-580 and PEP-590. PyPy improves on this…
comment by zbentley · 2025-11-11 · in How often does Python allocate? -
With respect to tagged pointers, there seems to be some recent movements on that front in CPython: https://github.com/python/cpython/issues/132509
comment by sushibowl · 2025-11-06 · in How often does Python allocate? -
…knew of them only ranging up to 256 ( https://stackoverflow.com/questions/306313 ). It turns out ( https://github.com/python/cpython/commit/7ce25edb8f41e527ed4... ) that the change is barely a month old in the repository; so it's not in…
comment by zahlman · 2025-11-01 · in How often does Python allocate? -
…applies to anything that implements `_iadd_` in C. Which does not appear to include native longs: https://github.com/python/cpython/blob/main/Objects/longobje...
comment by Groxx · 2025-10-25 · in The future of Python web services looks GIL-free -
…play. As an example these are the changes that had to be done to the standard library json module: https://github.com/python/cpython/pull/119438/files#diff-efe... This is how much of the standard library has been audited:…
comment by rogerbinns · 2025-10-25 · in The future of Python web services looks GIL-free -
For all those making πthon jokes: https://github.com/python/cpython/pull/125035
comment by Harmon758 · 2025-10-10 · in Python 3.14 is here. How fast is it? -
πthon: https://github.com/python/cpython/pull/125035
comment by Harmon758 · 2025-10-08 · in Python 3.14.0 is now available -
Not entirely missed: https://github.com/python/cpython/pull/125035
comment by Harmon758 · 2025-10-08 · in What's New in Python 3.14