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. …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…
  2. …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
  3. …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
  4. …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
  5. 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
  6. …- 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…
  7. …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
  8. 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
  9. …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…
  10. …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
  11. …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...
  12. …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
  13. …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
  14. …REPL is implemented[1] [0]: https://docs.python.org/3/library/code.html#code.Interactive... [1]: https://github.com/python/cpython/blob/02d9f1504beebd98dea80...
  15. …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…
  16. …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...
  17. …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
  18. …`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
  19. …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
  20. …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,…
  21. …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
  22. …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
  23. 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
  24. 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?
  25. …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
  26. …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
  27. …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:…
  28. …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
  29. 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
  30. Just copy out cgi.py and use it as a module. https://github.com/python/cpython/blob/3.11/Lib/cgi.py
  31. …you can then import. Even if they don’t, from a cursory view, it seems it’s a pure python library ( https://github.com/python/cpython/blob/main/Lib/telnetlib.py ). If so, can’t you copy the current code into your project? You would take on…
  32. …implementation in the python stdlib https://docs.python.org/3/library/difflib.html#difflib.Seque... https://github.com/python/cpython/blob/main/Lib/difflib.py
  33. …want to await several tasks at once, so I am not sure this changes much for exception handling. * https://github.com/python/cpython/issues/90908 ** https://docs.python.org/3.11/library/asyncio-task.html#task-...
    comment by nicoco · 2022-10-25 · in Python 3.11.0 final
  34. …This is misleading... you can use asyncio.gather which does this internally [0]. [0]: https://github.com/python/cpython/blob/main/Lib/asyncio/task...
    comment by throwway2332 · 2022-10-22 · in Python and Async Simplified (2018)
  35. …middle (via an iterator) in O(1), so it's not a complete replacement for doubly-linked lists. [1]: https://github.com/python/cpython/blob/a4ac14faa5c2be433738d...
  36. …thread in the same interpreter though, so I still don't understand robertlagrant's question. [1]: https://github.com/python/cpython/blob/4b81139aac3fa11779f6e...
    comment by remram · 2022-09-21 · in Faster CPython 3.12 Plan
  37. "the slow-but-simple implementation in module dbm.dumb will be used" No kidding. https://github.com/python/cpython/blob/main/Lib/dbm/dumb.py It uses a text file to store keys and pointers into a binary file for values. It works .. most of…
  38. FWIW, it was added in 1992. https://github.com/python/cpython/commit/dd9ed839d6958f73704... with gdbm added in 1994. https://github.com/python/cpython/commit/4b4c664d2e93279c8d7... .
  39. …what you want and then try again if it’s outside your range. And indeed this is how Python does it https://github.com/python/cpython/blob/e37ac5fbb6de593521cf2... https://github.com/python/cpython/blob/e37ac5fbb6de593521cf2...
  40. The ValueError in "2*2*2*2*2" is a recent change to limit denial of service attacks. See https://github.com/python/cpython/issues/95778 . In short, the value you want has 19729 digits in base-10, the conversion from the internal base-30…
  41. …algorithm exists to do otherwise." isn't true. This comment in particular is worth reading: https://github.com/python/cpython/issues/95778#issue-1331477...
  42. …this or done the math rigorously :) edit: this is also buried in the issue. There’s also: https://github.com/python/cpython/issues/90716 I don’t get it.
  43. …there is no algorithm for this that isn't quadratic. Update: I may have understood incorrectly, see https://github.com/python/cpython/issues/90716
  44. …a lot of discussion afterwards--but because the discussion was on-topic, the issue was not locked. https://github.com/python/cpython/issues/90716
    comment by klodolph · 2022-09-07 · in Prevent DoS by large int-str conversions
  45. It looks like there is some discussion of the algorithmic options at https://github.com/python/cpython/issues/95778 https://github.com/python/cpython/issues/90716 Is there something bad going on with Python's internal representation of big…
  46. …numpy test suite passes before https://github.com/numpy/numpy/issues/22098 is widely available. https://github.com/python/cpython/blob/511ca9452033ef95bc7d7...
  47. https://github.com/python/cpython/issues/95778 has more information.
  48. …its native permutations function. The C source is, as always, extremely easy to understand: https://github.com/python/cpython/blob/main/Modules/itertool...
    comment by qsort · 2022-08-23 · in Permutation Generation Methods [pdf]
  49. I totally missed that! Thanks for the additional detail. This issue appears to have been fixed: https://github.com/python/cpython/issues/75820
    comment by benji-york · 2022-08-16 · in Ask HN: Can I see your scripts?
  50. …before Am I missing a particular point the article is making, or did the author overlook this? [0]: https://github.com/python/cpython/blob/main/Lib/_py_abc.py