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. …the last month and a few more in flight. I.e the project has already started. See for example https://github.com/python/cpython/pull/25152
  2. Why isn't this hosted at https://github.com/python/cpython/issues ?
  3. This project has already submitted a few small changes into cpython, like https://github.com/python/cpython/pull/25069 and https://github.com/python/cpython/pull/25729
  4. …notes (alongside an explicit statement that it would become default four years later in 3.10): https://github.com/python/cpython/blob/a41782cc84bcd813209a0...
  5. …and it's already no small feat to have added them without breaking backwards compatibility. [0] https://github.com/python/cpython/blob/8a232c7b17a2e41ae14d8...
  6. …cannot assign to literal [0]: https://docs.python.org/3/library/stdtypes.html#float.fromhe... [1]: https://github.com/python/cpython/blob/5ce227f3a767e6e44e7c4... [2]: https://github.com/python/cpython/blob/5ce227f3a767e6e44e7c4...
  7. …It doesn't, since 3.8. It tries fcopyfile() and only if it fails, does the read/write dance. See: https://github.com/python/cpython/blob/master/Lib/shutil.py#...
    comment by vetinari · 2021-04-08 · in Surprisingly Slow
  8. https://github.com/python/cpython/blob/master/Objects/dictob...
    comment by knome · 2021-03-26 · in How to implement a hash table in C
  9. …an attribute that begins with assert Or any of the names in this surprising hardcoded list of typos https://github.com/python/cpython/blob/fdb9efce6ac211f973088...
    comment by progval · 2021-03-25 · in My Python testing style guide (2017)
  10. …Python 3.x being slower than 2.x. [0] https://rubykaigi.org/2016/presentations/tanaka_akr.html [1] https://github.com/python/cpython/blob/8d21aa21f2cbc6d50aab3... [2] https://github.com/python/cpython/blob/39f643614d03748a5fad4...
  11. …pass Here is the C version (with a comment a little way down describing the "fast path advantages": https://github.com/python/cpython/blob/93d33b47af70ede473f82...
  12. …Counter.update instead because I thought linking to the call site is clearer), but here it is: https://github.com/python/cpython/blob/2fe408497e6838b6fb761... Again, very straightforward, based on dict. Python itself does not function at…
  13. …amount of) overhead. Now, dict is optimized, but that's a builtin type. You don't need PSL. https://github.com/python/cpython/blob/2fe408497e6838b6fb761...
  14. …as a performance optimization. Type-specific free lists (just a few examples; there are more): * https://github.com/python/cpython/blob/master/Objects/floato... * https://github.com/python/cpython/blob/master/Objects/tupleo... And also…
    comment by loeg · 2021-03-13 · in Speed of Rust vs. C
  15. Thank you for the pointer. Seems they have already fixed it. https://github.com/python/cpython/pull/24721/files
  16. There's a "Show Source" link in the navigation that points to https://github.com/python/cpython/blob/master/Doc/whatsnew/3...
  17. It's not that powerful, if I'm reading it correctly: https://github.com/python/cpython/commit/34df10a9a16b38d5442... The sprintf is to a temporary buffer that's converted to a PyUnicode object before returning, so subsequent portions of…
  18. …repr'd, an sprintf call with a statically sized buffer of 256 bytes is used to produce a string: https://github.com/python/cpython/commit/d9b8f138b7df3b455b54653ca59f491b4840d6fa#diff-4e23b3237d0aa08bf4c434d75fab19200a80837bd147051fefccd98b…
  19. ▲ 3
    A great optimization for CPython with great benchmarking results
    story by androdiscens · 2021-02-15 · 1 comment
  20. For reference, here is the live copy of longobject.c: https://github.com/python/cpython/blob/master/Objects/longob... Python 2 had distinct `int` and `long` types, but Python 3 merged them together into just `int`. I wasn't sure if the…
  21. https://github.com/python/cpython/commit/b71c7dc9ddd6997be49... commit b71c7dc9ddd6997be49ed6aaabf99a067e2c0388 Author: Victor Stinner <victor.stinner@gmail.com> Date: Fri Oct 10 11:55:41 2014 +0200 Issue #22591: Drop support of MS-DOS…
    comment by eesmith · 2021-01-24 · in Pip has dropped support for Python 2
  22. …treated as a format string _if_ there are arguments. If not, it is treated as a literal string: https://github.com/python/cpython/blob/dcea78ff53d02733ac598...
  23. PyCon totally does affect python.tar.gz. https://github.com/python/cpython/pulls?q=+label%3Asprint (and that link doesn’t capture the PEPs hashed out among other things.) Also, why the hell make a new account for each comment?
  24. …for macOS 11 and Apple Silicon count? Here's a list of Apple-submitted PRs on python/cpython: https://github.com/python/cpython/pulls?q=is%3Apr+author%3Al... Also some co-authored patches excluded by the search. See…
  25. …is part of the standard library, and was part of the standard library in 3.0, and contained reduce: https://github.com/python/cpython/blob/3.0/Lib/functools.py#... What he meant to say is that it's removed from the list of builtins.
  26. Python's developers must have enormous heads if that's the case: https://github.com/python/cpython/blob/b8fde8b5418b75d2935d0...
    comment by brobinson · 2020-12-21 · in Write code. Not too much. Mostly functions.
  27. There are fast-paths for these cases, like this one: https://github.com/python/cpython/blob/4b8cdfcb22fbeaab9d954... (and note the comment above it about integer addition!) But the cpython folk make understandability an explicit goal of…
    comment by ketralnis · 2020-12-11 · in How the Python object system works
  28. Thanks. So it seems both were updated with 'key' at the same time: https://github.com/python/cpython/commit/871934d4cf00687b3d1... Now I'm wondering - what is the point of the python version, if it will always be overridden by the C…
    comment by rahimnathwani · 2020-11-23 · in Using Python's Bisect Module
  29. …is in Modules/_bisectmodule.c, whereas the Python version is in Lib/bisect.py. Python version: https://github.com/python/cpython/blob/master/Lib/bisect.py C version: https://github.com/python/cpython/blob/master/Modules/_bisec...
    comment by kaunta · 2020-11-22 · in Using Python's Bisect Module
  30. https://github.com/python/cpython/blob/master/Lib/bisect.py
    comment by rahimnathwani · 2020-11-22 · in Using Python's Bisect Module
  31. …Proposal to use PEG parser in python https://www.python.org/dev/peps/pep-0617/ Python PEG grammar https://github.com/python/cpython/blob/3.9/Grammar/python.gr...
  32. …of its hash table implementation that it has been optimized over and over decades now. [1]: https://github.com/python/cpython/blob/master/Objects/dictob... [2]: https://github.com/redis/redis/blob/unstable/src/dict.c
  33. …and it'll yield values (not hard to do with a recursive one, I just didn't feel like it): https://github.com/python/cpython/blob/2.7/Lib/contextlib.py... Seems like the __new__/__init__ issues exist with ExitStack as well, unlike with…
  34. …[2]: https://repl.it/@Groxx/TepidRosybrownLocatorprogram#main.py [3]: https://github.com/python/cpython/blob/master/Lib/contextlib...
  35. In fact, that's exactly how Python implements UNARY_NEGATIVE: https://github.com/python/cpython/blob/v3.9.0/Python/ceval.c... If you look a bit further down in the original article, you'll see that the BINARY_ADD instruction does something…
    comment by teraflop · 2020-11-09 · in How Python bytecode is executed
  36. Direct threading is in here https://github.com/python/cpython/blob/0564aafb71a153dd0aca4...
    comment by jashmatthews · 2020-10-28 · in Pyston v2: Faster Python
  37. …based interpreter it was 20 years ago. no threading, no super instructions, no jitting, nothing. https://github.com/python/cpython/blob/master/Python/ceval.c...
    comment by toolslive · 2020-10-28 · in Pyston v2: Faster Python
  38. …unless you supply your own timer, and time.perf_counter does measure wall clock time. See https://github.com/python/cpython/blob/ec42789e6e14f6b6ac135... https://docs.python.org/3/library/time.html#time.perf_counte...
  39. …for release in December. Details available here: https://pybind11.readthedocs.io/en/latest and https://github.com/python/cpython/pull/22670 .
    comment by wjakob · 2020-10-20 · in Python 3.9
  40. …'b']) where the namedtuple function actually has to hack around the fact that it's not a macro : https://github.com/python/cpython/blob/644e94272a89196801825... tldr: Foo needs to have __module__ = 'yourmodule' __qualname__ =…
    comment by uryga · 2020-10-15 · in PEP 638 – Syntactic Macros
  41. …with a finite maxsize. Implementation-wise it's identical to using maxsize=None. See source: https://github.com/python/cpython/blob/3.9/Lib/functools.py#...
    comment by uyt · 2020-10-05 · in Python 3.9
  42. …including CPython, use computed gotos for a not insignificant performance improvement. https://github.com/python/cpython/blob/master/Python/ceval.c...
    comment by Jasper_ · 2020-09-24 · in How the CPython compiler works
  43. …can be found in ceval.c. There is a big switch case for each python bytecode opcode starting at https://github.com/python/cpython/blob/master/Python/ceval.c... One can see even the simplest operations call quite a lot of stuff. I gave up…
    comment by xaedes · 2020-09-24 · in How the CPython compiler works
  44. …as I can tell functools.partial has been implemented in C since it was added sixteen years ago ( https://github.com/python/cpython/commit/9c323f8de4910dfc0ba... . ), and it's faster than lambda ( https://gist.github.com/wrmsr/1e13eda3ed7828…
  45. …as I can tell functools.partial has been implemented in C since it was added sixteen years ago ( https://github.com/python/cpython/commit/9c323f8de4910dfc0ba... ), and it's faster than lambda ( https://gist.github.com/wrmsr/1e13eda3ed782886…
  46. In case anyone is curious, sets were dicts in the original implementation: https://github.com/python/cpython/blob/a690a9967e715663b7a42... It was changed in 2005 for python 2.5 https://github.com/python/cpython/commit/9f1a6796eb83a2884df...
  47. …digging through history, it looks like the change in behavior for byte strings was intentional: https://github.com/python/cpython/commit/6ccd3f2dbcb98b33a71... Author: Guido van Rossum <guido@python.org> Date: Tue Oct 9 03:46:30 2007 +0000…
  48. ▲ 188
    In the Turkish locale, "INFO".lower() != "info"
    story by duckerude · 2020-08-16 · 282 comments
  49. …of real-life VMs. Even VMs which do interpret don’t do the way written in the article, take a look: https://github.com/python/cpython/blob/v3.9.0rc1/Python/ceva... What exactly it is you’re learning then?
    comment by Const-me · 2020-08-15 · in Write Your Own Virtual Machine
  50. …or IO bound tasks in Python, for example when reading from a socket the GIL gets released at https://github.com/python/cpython/blob/e822e37946f27c09953bb...