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. …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)
  2. …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:…
  3. …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),…
  4. …`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/...
  5. …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... .
  6. …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?
  7. …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
  8. …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
  9. …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
  10. …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
  11. 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…
  12. …here is 32 bits), which calls _Py_popcount32, which does map to a hardware instruction if possible: https://github.com/python/cpython/blob/f62ad4f2c4214fdc05cc4...
  13. Sadly it does not call into the hardware implementation: https://github.com/python/cpython/blob/f62ad4f2c4214fdc05cc4...
  14. …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
  15. 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.
  16. …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
  17. …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…
  18. …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…
  19. …After six years of intense bikeshedding, it was finally put in standard "datetime" in 2018. [1] https://github.com/python/cpython/issues/60077
  20. …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…
  21. Python's main interpreter loop is a single 4k line function. https://github.com/python/cpython/blob/main/Python/ceval.c#L...
  22. …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...
  23. …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...
  24. …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…
  25. …[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
  26. You don't have to find an alternative. Just copy the parts you need into your own code: https://github.com/python/cpython/blob/main/Lib/cgi.py
    comment by iso8859-1 · 2022-03-18 · in Python finally offloads some batteries
  27. …more than just a single hardware add per Python "add." You can see the actual implementation here: https://github.com/python/cpython/blob/main/Objects/longobje... You've got multiple for loops over every digit, array dereferencing, plus…
  28. Python is similar[1] >The growth pattern is: 0, 4, 8, 16, 25, 35, 46, 58, 72, 88, ... https://github.com/python/cpython/blob/3.7/Objects/listobjec...
  29. CPython appears to use a PEG parser for its implementation: https://github.com/python/cpython/blob/b77158b4da449ec5b8f68...
    comment by linux2647 · 2022-02-20 · in Things that used to be hard and are now easy
  30. …the value of `exit` if you so choose. "Special cases aren't special enough to break the rules." [1] https://github.com/python/cpython/blob/06b8f1615b09099fae5c5...
    comment by luhn · 2022-02-06 · in What's in a good error message?
  31. > CPython does not do these things. Again, it is. https://github.com/python/cpython/blob/2d080347d74078a55c477... This is the memmove() I mentioned above. Like, I actually perf-d the code and confirmed this is in the hot loop. > but 1553D…
  32. Hmm, it looks like it’s handled comments for at least a decade: https://github.com/python/cpython/blame/d75a51bea3c2442f81d3... Oh, maybe it’s this issue: https://bugs.python.org/issue34132 If I’ve read it correctly, there was a regression…
  33. …handled alternative. I filed a PR with a proposed documentation improvement in mid December: https://github.com/python/cpython/pull/30142 Apart from one drive-by comment from a non-core contributor, no-one has commented on the pull request…
  34. …is implemented by constructing _string representations_ of functions and calling `exec` on them. https://github.com/python/cpython/blob/3.10/Lib/dataclasses.... Kind of blew my mind
  35. …else (if it even throws anything else?) to be fatal. This is the same way cpython handles it: https://github.com/python/cpython/blob/b56774bd93822e1598bb5... The context manager idea sounds good, but I think that might require a lot of…
  36. Python's csv imports _csv for core functionality, which is C: https://github.com/python/cpython/blob/main/Modules/_csv.c
  37. …ps://github.com/php/php-src/blob/1c0e613cf1a24cdc159861e4... - Python's C implementation is the same: https://github.com/python/cpython/blob/main/Modules/_csv.c - Java doesn't have a "standard" way at all (…
    comment by mschuster91 · 2021-12-16 · in Leveraging SIMD: Splitting CSV Files at 3Gb/S
  38. The `eval()` in the namedtuple factory function[1] makes it a bit kludgy, IMO. [1]: https://github.com/python/cpython/blob/3.10/Lib/collections/...
    comment by woadwarrior01 · 2021-12-12 · in The Data Classes Decorator
  39. …random probes or by chasing linked list references to random memory locations for each link. https://github.com/python/cpython/blob/f840398a5fd8741653c26...
    comment by raymondh · 2021-11-23 · in A Tale of Java Hash Tables
  40. …more to say about how list resizing works than is immediately obvious. The relevant source is here: https://github.com/python/cpython/blob/main/Objects/listobje... As the article points out, the size progression, as detailed in the comment…
    comment by kgm · 2021-11-14 · in How Python List Works
  41. How a Python list really works? See the underlying C implementation: https://github.com/python/cpython/blob/main/Objects/listobje... ; https://github.com/python/cpython/blob/main/Include/listobje... For comparison, java.util.ArrayList is…
    comment by nayuki · 2021-11-14 · in How Python List Works
  42. …they can easily determine they are the exclusive owner by checking for a reference count of 1. See: https://github.com/python/cpython/blob/main/Objects/unicodeo... Rust's ownership system ensures that there cannot exist mutable and…
    comment by MarkSweep · 2021-11-14 · in A terrible schema from a clueless programmer
  43. …to work with. The setup takes no effort at all and it "just works", batteries included, via ctypes. https://github.com/python/cpython/blob/main/Lib/multiprocess...
  44. …-- it reads as if it will only kick in on linux if it detects a sufficiently new version of glibc: https://github.com/python/cpython/blob/main/Lib/subprocess.p... edit: Python 3.10 now supports using vfork for linux inside subprocess:…
  45. …or not CPython doesn't have a JIT, it has an interpreter. So it spends a lot of time in this loop: https://github.com/python/cpython/blob/main/Python/ceval.c But you still have a repl with pypy. The downsides of JIT is that compiling…
  46. Correct link: https://github.com/python/cpython/blob/3.10/Lib/turtle.py#L3...
    comment by danbst · 2021-11-03 · in A German Easter Egg in Python Turtle
  47. …com/clap-rs/clap/pull/1637#issuecomment-58103... [1] https://tldp.org/LDP/abs/html/exitcodes.html [2] https://github.com/python/cpython/blob/main/Lib/argparse.py#...
  48. …I can cheat and copy anyway since only the non-refcounted ones are allowed in them. [0] https://github.com/python/cpython/blob/main/Include/object.h...
    comment by sizediterable · 2021-10-29 · in Building an Emacs Lisp VM in Rust
  49. I meant actual code from their library So https://github.com/python/cpython/tree/main/Python
    comment by savant_penguin · 2021-10-25 · in To learn a new language, read its standard library
  50. re depends ultimately of this c file https://github.com/python/cpython/blob/main/Modules/_sre.c
    comment by makapuf · 2021-10-08 · in Faster Python with Guido van Rossum