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. Just copy out cgi.py and use it as a module. https://github.com/python/cpython/blob/3.11/Lib/cgi.py
  2. …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…
  3. …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
  4. ▲ 2
    CPython: Generate the Interpreter
    story by fniephaus · 2022-11-01 · 0 comments
  5. …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
  6. …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)
  7. …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...
  8. …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
  9. "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…
  10. 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... .
  11. …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...
  12. 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…
  13. …algorithm exists to do otherwise." isn't true. This comment in particular is worth reading: https://github.com/python/cpython/issues/95778#issue-1331477...
  14. …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.
  15. …there is no algorithm for this that isn't quadratic. Update: I may have understood incorrectly, see https://github.com/python/cpython/issues/90716
  16. …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
  17. 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…
  18. …numpy test suite passes before https://github.com/numpy/numpy/issues/22098 is widely available. https://github.com/python/cpython/blob/511ca9452033ef95bc7d7...
  19. https://github.com/python/cpython/issues/95778 has more information.
  20. ▲ 2
    CVE-2020-10735: Prevent DoS by large intstr conversions
    story by josephcsible · 2022-09-07 · 1 comment
  21. ▲ 146
    Prevent DoS by large int-str conversions
    story by genericlemon24 · 2022-09-07 · 196 comments
  22. …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]
  23. ▲ 2
    CPython PR #95908 – Add support for the BOLT post-link binary optimizer
    story by susam · 2022-08-19 · 0 comments
  24. 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?
  25. …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
  26. …in Python since each comparison can call a Python function) so all numbers are given as such. [1] https://github.com/python/cpython/blob/main/Objects/listsort...
    comment by lifthrasiir · 2022-07-29 · in Timsort (2019)
  27. …ever read how time libraries are actually written? Please, go read the Python `datetime` library: https://github.com/python/cpython/blob/0fe645d6fd22a6f57e777... which is used to calculate a UTC timestamp:…
  28. …Python ought to be portable across Python implementations. I was merely pointing out that this line https://github.com/python/cpython/blob/4395ff1e6a18fb26c7a66... isn’t exactly pure Python, because, under a different runtime (eg PyPy),…
  29. …`dict` type. I don't think it's comparable to something like using `pandas` to solve the problem. https://github.com/python/cpython/blob/main/Lib/collections/...
  30. …to the head. And it is in fact implemented as a doubly linked list, with various optimizations: https://github.com/python/cpython/blob/v3.8.1/Modules/_colle... .
  31. …Documentation still hasn't been written for it yet though and that's why the issue is still open, https://github.com/python/cpython/issues/90908 .
    comment by Mehdi2277 · 2022-06-27 · in What's New in Python 3.11?
  32. …module uses HTTP/1.1 and includes a "Connection:close" header in its HTTP requests" [1] [1] https://github.com/python/cpython/blob/3.10/Lib/urllib/reque... You seem to be correct about urllib3 and requests, I was wrong there...though they…
    comment by tyingq · 2022-06-21 · in Get Paid to Contribute to Urllib3
  33. …module is imported and the enable function is called. [1]: https://peps.python.org/pep-0523/ [2]: https://github.com/python/cpython/blob/main/Python/ceval.c
    comment by woadwarrior01 · 2022-06-08 · in Pyston-lite: our Python JIT as an extension module
  34. …it's been nothing on the beta branch, I think. For example this PR is not getting merged, it seems. https://github.com/python/cpython/pull/93379
  35. …core devs. This wasn't the case, just a few years ago. [1]: https://peps.python.org/pep-0659/ [2]: https://github.com/python/cpython/blob/main/Python/ceval.c
  36. The rationale was here. https://github.com/python/cpython/issues/85067#issuecomment-... It seems a bit vague: « Exposing this attribute would help with introspection, making it possible to write efficient functions that operate on dict…
  37. …here is 32 bits), which calls _Py_popcount32, which does map to a hardware instruction if possible: https://github.com/python/cpython/blob/f62ad4f2c4214fdc05cc4...
  38. Sadly it does not call into the hardware implementation: https://github.com/python/cpython/blob/f62ad4f2c4214fdc05cc4...
  39. …Sam Gross' work: https://docs.google.com/document/d/18CXhDb1ygxg-YXNBJNzfzZsD... The GIL code: https://github.com/python/cpython/blob/main/Python/ceval_gil... Py_INCREF: https://github.com/python/cpython/blob/a4460f2eb8b9db46a9bce...
    comment by kortex · 2022-05-18 · in Python 3.11 beta vs. 3.10 benchmark
  40. The Python source - https://github.com/python/cpython/ - with full commit history back to 1990. The Unix source - https://github.com/dspinellis/unix-history-repo - with quite a number of releases dating back to 1970.
  41. …its roots in 1998 or so. You can see how primitive testing was with this example from Python 1.3: https://github.com/python/cpython/blob/v1.3/Lib/test/test_b2... . That's actually one of the most sophisticated ones there. The test_md5…
    comment by eesmith · 2022-05-12 · in I'd love a history of Python tooling
  42. …or thereabouts. [1] 3.7.0 is the first major release following the removal of the config option in https://github.com/python/cpython/issues/75551 .. there's also a 2021 comment about "This has unfortunately turned out to be a blocker on…
  43. …source code links for standard library results. E.g. searching for heapq would also show a link to https://github.com/python/cpython/blob/main/Lib/heapq.py I know these links are already at the very top of most pages in the python…
  44. …After six years of intense bikeshedding, it was finally put in standard "datetime" in 2018. [1] https://github.com/python/cpython/issues/60077
  45. …languages with closed source development). For Python, it looks like everything is on GitHub: https://github.com/python/cpython https://github.com/python/peps It might take some exploring depending on what you are trying to find (over 100k…
  46. Python's main interpreter loop is a single 4k line function. https://github.com/python/cpython/blob/main/Python/ceval.c#L...
  47. …STORE_FAST 0 (a) 8 STORE_FAST 1 (b) 5 10 LOAD_FAST 0 (a) 12 RETURN_VALUE Implementation of ROT_TWO https://github.com/python/cpython/blob/bc85eb7a4f16e9e2b6fb7...
  48. …a closed connection, which the SQLite C documentation warns against. A couple of searches against https://github.com/python/cpython lead me to this code here: https://github.com/python/cpython/blob/4674fd4e938eb4a29ccd5...
  49. …short Python wrapper around binascii. It's only 206 lines, much of which is comments or docstrings: https://github.com/python/cpython/blob/a5b7678a67ac99edd5082... It has three functions: one to encode, one to decode, and one to show usage…
  50. …[1]. To be honest, I was really surprised how needlessly complex that particular code is. [1] - https://github.com/python/cpython/blob/main/Lib/argparse.py
    comment by genmud · 2022-03-18 · in Python finally offloads some batteries