Hacker GitHub

← All repos

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

Mentions per year 548 mentions · busiest year 2025 (72)
20082026
  1. …what signal was caught and executes the signal handler, before trying to do the remaining write: https://github.com/python/cpython/blob/5f7aba938cf5007b6f954... Here's even a test for it: https://github.com/python/cpython/blob/5f7aba938cf50…
  2. …[0] just as well as in subinterpreters (and currently isn't implemented in either one). [0] https://github.com/python/cpython/issues/89467
    comment by ptx · 2023-10-02 · in Python 3.12
  3. …then no, it doesn't. None of the variables in the outer scope are captured in the class instance. https://github.com/python/cpython/blob/main/Lib/functools.py... Here's a simplified version of that code that demonstrates the pattern. class…
    comment by Spivak · 2023-09-20 · in Fixing for loops in Go 1.22
  4. …urllib library recently had a CVE for failing to strip whitespace from the scheme and domain. https://github.com/python/cpython/issues/102153
    comment by richbell · 2023-09-07 · in When URL parsers disagree
  5. …off made for a slightly more efficient implementation. The initial commit of these two functions - https://github.com/python/cpython/commit/96229b191814556622b... - is exactly as Guido’s suggestion, but does include a test case for empty…
  6. …3 >>> (x % 1).limit_denominator(9999) Fraction(375, 1757) The mediant-based implementation is at https://github.com/python/cpython/blob/607f18c89456cdc9064e2...
    comment by eesmith · 2023-08-15 · in Decimal to fraction
  7. …will also do something like that, specifically it snips out repeated lines in self-recursive calls: https://github.com/python/cpython/issues/71010 >>> a() Traceback (most recent call last): File "<stdin>", line 1, in <module> File…
    comment by masklinn · 2023-08-08 · in Go 1.21 Released
  8. …global functions (I overlooked it at first). The library makes this on the fly with a nice trick: https://github.com/python/cpython/blob/f978a79130133de1cf264... they make a global function for each of methods of the turtle class by means…
    comment by MichaelMoser123 · 2023-08-05 · in Ways to teach kids to code (2016)
  9. …on any Python 3.8 or greater running on MacOS, enforced via "platform == darwin" runtime check: https://github.com/python/cpython/pull/13626/files#diff-6836... You can check the default process-start method of your Python's multiprocessing…
  10. …issue below, this can occasionally cause issues, but in my experience it does so rarely if ever. 1. https://github.com/python/cpython/issues/77906 2. https://docs.python.org/3/library/multiprocessing.html#conte...
  11. …> Can we get an in-python fork() mechanic ... please? You probably want Multiple Subinterpreters: https://github.com/python/cpython/issues/84692
  12. …trace from quite a way back when e.g. the first commit in which I can find the len() builtin ( https://github.com/python/cpython/commit/c636014c430620325f8... ) also has calls to file.read and list.append, and the first python-level…
    comment by masklinn · 2023-07-25 · in Python: Overlooked core functionalities
  13. …s://github.com/dabeaz-course/practical-python/blob/maste... [3] https://peps.python.org/pep-0617/ [4] https://github.com/python/cpython/blob/3.8/Grammar/Grammar [5] https://github.com/python/cpython/blob/1663f8ba8405fefc82f74... [6]…
    comment by jamesdutc · 2023-07-19 · in Advanced Python Mastery
  14. …the interpreter code: 1. PyList_SetItem calls Py_XSETREF(dst, src) where dst is the list position: https://github.com/python/cpython/blob/ee46cb6aa959d891b0a48... 2. Py_XSETREF calls Py_XDECREF on the old item:…
  15. …for CPython and Postgre - which lines of code would you need to touch to achieve these purposes? https://github.com/python/cpython In json module: add parameter to load() and loads() that when True only allows spaces as whitespace…
  16. Oh, and multi-line statements will be supported from Python 3.13 ( https://github.com/python/cpython/issues/103124 )
    comment by johnnymellor · 2023-06-29 · in CLI tools hidden in the Python standard library
  17. …or probably a PEP to add new functionality to exec. I'll file a bug against Python soon. [1]: https://github.com/python/cpython/blob/25a64fd28aaaaf2d21fae... [2]: https://github.com/python/cpython/blob/25a64fd28aaaaf2d21fae...
    comment by johnnymellor · 2023-06-29 · in CLI tools hidden in the Python standard library
  18. …because most operating systems have sqlite3 and python3, but are missing the SQLite CLI. [0]: https://github.com/python/cpython/blob/3fb7c608e5764559a718c... [1]: https://docs.python.org/3.12/library/sqlite3.html#command-li...
  19. …with magnitudes of inputs etc all over the dang place. Like, seriously, everywhere. Take a look: https://github.com/python/cpython/blob/main/Objects/longobje... I certainly hope for at least some of that code the compiler ends up making…
  20. …I just went for CPython's implementation of `list`. It took me less than 2 minutes to find it: https://github.com/python/cpython/blob/main/Objects/listobje... . If you're curious, CPython essentially grows its dynamic array by ⅛ (12.5%)…
    comment by qsantos · 2023-06-18 · in Python Dict – An Explorable Explanation
  21. …module [1] even though it was mentioned as part of the rationale in PEP 574 [2]. [1] https://github.com/python/cpython/issues/89467 [2] https://peps.python.org/pep-0574/
    comment by ptx · 2023-06-16 · in Our Plan for Python 3.13
  22. …I understand is in fact originally a Django creation too (or at least its first popularising use https://github.com/python/cpython/issues/65344 ).
    comment by evrimoztamur · 2023-06-10 · in Django Views – The Right Way
  23. Since 2001, it seems: https://github.com/python/cpython/blob/3.11/Lib/doctest.py#L...
    comment by bradbeattie · 2023-06-10 · in Executable Examples in Go
  24. …- I haven't yet used non-ASCII in my code! Then you may enjoy this april fool's python issue I made https://github.com/python/cpython/issues/103172 Yeah, I like using utf-8 chars for mathematical symbols, it makes my brain hurt a little…
  25. …are emitted, and paw through the main evaluation loop [1]; or take a guided walkthrough at [2]. [1] https://github.com/python/cpython/blob/v3.6.14/Python/ceval.... (note this is an old version, you can change that in the url) [2]…
    comment by klyrs · 2023-05-11 · in Faster CPython at PyCon, part one
  26. Looks like cpython does the same thing if for small n. https://github.com/python/cpython/blob/a9c6e0618f26270e2591b...
    comment by Atlas22 · 2023-05-09 · in Codon: Python Compiler
  27. ▲ 2
    CPython Timsort Implementation Notes
    story by juliusgeo · 2023-05-05 · 1 comment
  28. …and put it on the stack. More specifically, we can look at the implementation of "LOAD_FAST" at https://github.com/python/cpython/blob/main/Python/generated... (which has is derived from https://github.com/python/cpython/blob/main/Python/by…
  29. ▲ 2
    Python Might Remove Math.pi?
    story by extasia · 2023-04-01 · 5 comments
  30. …since the antigravity module doesn't have a fly attribute, and it "does its thing" on import. https://github.com/python/cpython/blob/main/Lib/antigravity....
    comment by wodenokoto · 2023-03-03 · in Why Python keeps growing, explained
  31. …that post, and it's what other languages use in similar situations (e.g. tuples in Python and C#): https://github.com/python/cpython/blob/71db5dbcd714b2e1297c4...
  32. …was, I guess, a “big-J” problem instead of this “small-j” problem, dealing with non-ASCII letters: https://github.com/python/cpython/issues/80730
  33. …kind of bytecode, who knows. The standard cpython implementation is much more complex, though: https://github.com/python/cpython/blob/main/Python/bltinmodu... Concatenating zip()s is an unnecessarily complex solution, both in terms of…
    comment by jeroenhd · 2023-02-27 · in Zig's multi-sequence for loops
  34. ▲ 2
    Cpython/Lib/Antigravity.py
    story by spenczar5 · 2023-02-22 · 0 comments
  35. …REPL is implemented[1] [0]: https://docs.python.org/3/library/code.html#code.Interactive... [1]: https://github.com/python/cpython/blob/02d9f1504beebd98dea80...
  36. …Because not eveyone uses an apt-based package manager. Python runs on quite a few platforms: https://github.com/python/cpython/blob/main/Lib/platform.py Apt is not the package manager for most of those platforms. Thus an operating system…
  37. …money or context, ~3yrs ago. 1. https://authors.library.caltech.edu/5456/1/hrst.mit.edu/hrs/... 2. https://github.com/python/cpython/blob/v3.11.1/Lib/logging/h... 3. https://www.komu.engineer/blogs/09/log-without-losing-contex...
  38. …can be changed without breaking backwards compatibility (current GC behavior is not deterministic): https://github.com/python/cpython/issues/91887 Latest reply from GvR is invoking Chesterton's Fence. Here's to hoping the devs can quickly…
    comment by terom · 2023-02-13 · in A Heisenbug lurking in async Python
  39. …`create_task()` is a little older, but also only November 2021, so during 3.11 development...? [1] https://github.com/python/cpython/commit/c750adbe6990ee8239b...
    comment by terom · 2023-02-13 · in A Heisenbug lurking in async Python
  40. …was only added in September 2022 [1], so no wonder this comes as a surprise to many! [1] https://github.com/python/cpython/commit/6281affee6423296893...
    comment by mhils · 2023-02-11 · in A Heisenbug lurking in async Python
  41. …in Python? Of course. With dataclasses that's what Python itself does; that's a pure Python module: https://github.com/python/cpython/blob/3.11/Lib/dataclasses.... For MutableMapping, Python currently implements it as a C class for speed,…
  42. …parametrized context, which is a trivial patch, and it has been just sitting there for 10 years: https://github.com/python/cpython/issues/53032 Adding code to import/export BID/DPD formats, while maybe not as trivial, seems still…
    comment by zokier · 2023-01-13 · in Examples of floating point problems
  43. …is IEEE 754 (well, based on the older standard, which has now been absorbed into IEEE 754): https://github.com/python/cpython/blob/main/Lib/_pydecimal.p... Cool, didn't know that gcc had built-in support. But is it really as incomplete as…
    comment by jordigh · 2023-01-13 · in Examples of floating point problems
  44. The same bug, but with more discussion can be found here: https://github.com/python/cpython/issues/100762 Apparently the problem is not with all(), but Generator creation
  45. Here’s the relevant source: https://github.com/python/cpython/blob/8dd2766d99f8f51ad62dc... I believe you should just be able to replace the library name with an absolute path to the library, and remove the need for the lookup at all?
  46. …with this approach was ECMAScript 2009 (5th ed.) with `use strict` and Python 3 predated it. [1] https://github.com/python/cpython/tree/main/Lib/lib2to3
    comment by lifthrasiir · 2023-01-03 · in Python 2 removed from Debian
  47. …of the Python standard library is written in Python and a good way to see idiomatic Python code. https://github.com/python/cpython/tree/main/Lib
  48. …standard library using exec() to create the `__init__` and other methods that go on your dataclass: https://github.com/python/cpython/blob/main/Lib/dataclasses.... Here's Pydantic using it for a jupyter notebook check:…
  49. …I cannot touch anything without finding a bug or at least a suspiciously insectoid lifeform.) [1] https://github.com/python/cpython/blob/7e3f09cad9b783d8968aa...
    comment by mananaysiempre · 2022-11-22 · in Always use [closed, open) intervals
  50. It's because cpython shortcuts through identity: https://github.com/python/cpython/blob/main/Objects/object.c... /* Quick result when objects are the same. Guarantees that identity implies equality. */ if (v == w) { if (op == Py_EQ) return…
    comment by masklinn · 2022-11-19 · in Go 1.21 may have a clear(x) builtin