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. …like in C). In case anyone cares how Python actually does in in C, for small ints its defined at https://github.com/python/cpython/blob/master/Objects/longob...
    comment by kmill · 2017-07-04 · in Block-breaking game in vim 8.0
  2. Python has migrated from hg to git. The current version of tupleobject.c is here: https://github.com/python/cpython/blob/master/Objects/tupleo...
    comment by jwilk · 2017-06-26 · in Diving into the world of hash tables
  3. …of locals use an internal array of local variables, to skip dicts. Same with constants. See: https://github.com/python/cpython/blob/master/Python/ceval.c...
    comment by adrian17 · 2017-06-26 · in Diving into the world of hash tables
  4. …typed "python" and got no results, which seems pretty odd.) I would have liked to browse this repo: https://github.com/python/cpython I guess you have to import repositories yourself? There seem to be sample repositories, but they are in…
  5. …awesome! I didn't know that too. It's pretty cool. Seems like they overload __truediv__ operator: https://github.com/python/cpython/blob/master/Lib/pathlib.py...
  6. Relevant: https://github.com/python/cpython/commit/30d00e54dde47b11f5b...
  7. …for comparing integers. ;) [0] http://doc.pypy.org/en/latest/cpython_differences.html#objec... [1] https://github.com/python/cpython/blob/master/Objects/longob... [2] https://github.com/python/cpython/blob/ba85d69a3e3610bdd05f0...
    comment by squeaky-clean · 2017-05-25 · in Show HN: 15-question programming quiz with answers
  8. 0-256 not sure about negatives -5 to 256 (inclusive) [ https://github.com/python/cpython/blob/master/Objects/longob... ]
  9. 0 to 256 if I recall right -5 to 256 (inclusive) [ https://github.com/python/cpython/blob/master/Objects/longob... ]
  10. That was apparently fixed in Python 2.7: https://github.com/python/cpython/commit/6116d4a1d1ecd6e9b94... http://bugs.python.org/issue12099 But that commit pre-dates the blog post by many years, so maybe Armin was referring to something…
  11. …where classes make sense in standard libraries would be (impure) interfaces such as csv.Dialect ( https://github.com/python/cpython/blob/6aee6fb/Lib/csv.py#L2... ) An example of where inherited classes make sense in abstraction would be…
  12. I just saw that Python's Makefile has support for PGO builds: https://github.com/python/cpython/blob/master/Makefile.pre.i... Not sure when it was added, but Python 2.7 has it. It's not clear to me how to tell if say my Ubuntu binary is…
  13. …python-git instead of the main Python repo. The whole project has been moved as of a couple months. https://github.com/python/cpython
  14. …old version of Python source from a mirror. It uses functools.lru_cache with a maxsize of 256 now: https://github.com/python/cpython/blob/fcfe80ec2592fed8b3941...
    comment by benhoyt · 2017-04-24 · in Glob Matching Can Be Simple and Fast Too
  15. …(in stdlibc it's just a double pointer to T IIRC). In Python it's a doubly-linked list of blocks: https://github.com/python/cpython/blob/master/Modules/_colle...
  16. The only codebase I've checked personally can't handle Y10K, so there should be plenty of business: https://github.com/python/cpython/blob/6f0eb93183519024cb360...
    comment by elevensies · 2017-03-21 · in 2038: Only 21 years away
  17. …things. I'm totally sure now. Guido's last commit, in both the github repo and the mercurial repo. https://github.com/python/cpython/commit/934aba66ef09e94422b... https://hg.python.org/cpython/rev/3db1959c2c53 Someone sensible may be able…
    comment by harry8 · 2017-02-13 · in Python moved to GitHub
  18. ▲ 820
    Python moved to GitHub
    story by c8g · 2017-02-12 · 305 comments
  19. ▲ 3
    Python officially moved to GitHub
    story by s4chin · 2017-02-11 · 0 comments
  20. ▲ 4
    CPython is now on GitHub
    story by Dowwie · 2017-02-10 · 0 comments
  21. …into a native environment block and gives it as the envp pointer to the exec/spawn functions. [1]: https://github.com/python/cpython/blob/a65137dc41fb52bdb1ca2... [2]: https://github.com/python/cpython/blob/a65137dc41fb52bdb1ca2... [3]:…
  22. …python source code[1] implementation of the Environment class, I think python is also affected. 1. https://github.com/python/cpython/blob/master/Lib/os.py#L664
    comment by RabbitmqGuy · 2017-01-31 · in Don't setenv in multi-threaded code on glibc
  23. The decimal module in Python 2.7 is implemented in pure Python: https://github.com/python/cpython/blob/2.7/Lib/decimal.py (in Python 3 there is an accelerated extension module that's used when available, falling back on the pure Python…
    comment by brettcannon · 2017-01-04 · in Grumpy: Go running Python
  24. Brett, thanks for contributions to Python. (... and thanks to the other contributors, https://github.com/python/cpython/blob/master/Misc/ACKS , and to all people who volunteer their by contributing to open source...) I am another silent…
    comment by jamesdutc · 2016-12-21 · in Taking a month off from OSS volunteering
  25. I doubt that because defining a namedtuple just creates a new class internally: https://github.com/python/cpython/blob/master/Lib/collection... Class creation the very expensive in Python, so Guido van Rossum explicitly recommends against…
    comment by skrause · 2016-12-08 · in What’s New In Python 3.6
  26. …can robustly parse many different dialects of CSV is quite a challenge. Have a read of Python's: https://github.com/python/cpython/blob/master/Lib/csv.py EDIT: It's probably not fair to say that nobody actually uses the RFC 4180 version of…
  27. ▲ 2
    CPython's documentation about lnotab_notes, the line number table
    story by nichochar · 2016-10-07 · 0 comments
  28. What about the code for this python regular expression engine that is filled with goto statements? https://github.com/python/cpython/blob/master/Modules/sre_li... Or the code for the OpenSSL handshake that interleaves preprocessing…
  29. …using str.split(',') which is completely different than Python's offering of dialect/delimiter/etc https://github.com/python/cpython/blob/master/Lib/csv.py#L24
  30. …helps. In Python, a list object over-allocates using a very peculiar, but finely tuned formula: https://github.com/python/cpython/blob/09dc3ec1713c677f71ba7...
    comment by justusw · 2016-08-23 · in When Big O Fools You
  31. …for example uses os.urandom for random UUID generation (uuid4), as can be seen in the source: https://github.com/python/cpython/blob/3.5/Lib/uuid.py#L603 The standard library guarantees that os.urandom is "[...] suitable for cryptographic…
    comment by justusw · 2016-08-20 · in How Long Should I Make My API Key?
  32. …grammar as specified in the file called Grammar in the canonical implementation of the language ( https://github.com/python/cpython/blob/master/Grammar/Gramma... ). Of course it's part of the grammar in the larger sense. I don't think that…
    comment by gary_bernhardt · 2016-08-08 · in Destroy All Software relaunches
  33. …those three problems and you didn't. I trust this reply will alleviate the misconception. [0]: https://github.com/python/cpython/blob/master/Objects/dictob... [1]: https://github.com/python/cpython/blob/master/Objects/dictob...
    comment by jsmthrowaway · 2016-07-14 · in Asciinema 1.3 Switches from Go Back to Python
  34. …hard way. For the curious, read through the comment here describing the data layout and invariants: https://github.com/python/cpython/blob/master/Include/unicod...
    comment by int_19h · 2016-06-20 · in UTF-8 Everywhere (2012)
  35. If you are lexing there is a much better way than trying to munge together a giant regex manually: https://github.com/python/cpython/blob/3.4/Lib/re.py#L346
    comment by justin_vanw · 2016-02-20 · in Python 3.4 supports only 100 regex groups
  36. https://github.com/python/cpython/commit/33455fe85760e0173ee...
  37. I guess you meant Python 3.4 because 3.5 has no limitation: https://github.com/python/cpython/blob/3.5/Lib/sre_compile.p...
    comment by namtrac · 2016-02-20 · in Python 3.4 supports only 100 regex groups
  38. ▲ 26
    Python 3.4 supports only 100 regex groups
    story by MosheZada · 2016-02-20 · 25 comments
  39. …handler before you restart the syscal on EINTR in C code. Look at how os.waitpid() is implemented: https://github.com/python/cpython/blob/master/Modules/posixm...
    comment by d0mine · 2016-02-09 · in Writing my own init with Go
  40. …This does not exist in Python 3[2] (and therefore neither does the performance difference). [1] https://github.com/python/cpython/blob/2.7/Python/ceval.c#L1... [2] https://github.com/python/cpython/blob/master/Python/ceval.c...
  41. …something like namedtuple there are other[2] things[3] you can use depending on your use-case. [1] https://github.com/python/cpython/blob/master/Lib/collection... [2] http://stackoverflow.com/a/2648186 [3]…
  42. …of just how easy CPython's implementation is to read in many cases. [1]: see this, for example: https://github.com/python/cpython/blob/0eb5f5996feed30ade8c2... [2]: https://github.com/python/cpython/blob/0eb5f5996feed30ade8c2... [3]:…
    comment by deathanatos · 2016-01-14 · in Complexity of Python Operations (2013)
  43. …so far the only git presence of Python was a "semi-official readonly mirror" on github: https://github.com/python/cpython now does this mean that Python will completely switch away from Mercurial? this was one of the major projects still…
    comment by anarcat · 2016-01-01 · in Python moves to GitHub
  44. Indeed, the Python 3 Unicode string object is fascinatingly clever. Code worth reading: https://github.com/python/cpython/blob/master/Objects/unicod...
    comment by twoodfin · 2015-12-17 · in Why Python 3 Exists
  45. …as c, sys as s; j.dump(j.load(s.stdin, object_pairs_hook=c.OrderedDict), s.stdout, indent=4)' [0] https://github.com/python/cpython/blob/3.5/Lib/json/tool.py#...
    comment by hnov · 2015-10-20 · in Httpie: A CLI http client
  46. Yeah, you do: https://github.com/python/cpython/blob/master/Objects/listob... You don't need unsafe code to make any data structure in Rust. Cycles can be made just fine using std::rc::Rc. The fact that it uses `unsafe` blocks under the…
  47. yeah by using python, you will never run into problems like this https://github.com/python/cpython/search?utf8=✓&q=gethostbyn...
  48. …the code because I don't have a debug build, so I might be completely wrong. Edit: Link to code: https://github.com/python/cpython/blob/a5c7a4257507a77699a1a...
    comment by nikital · 2014-12-30 · in Python: Faster Way