r/Python • • Feb 28 '18

[TIL] CPython is mostly written in Python (not C)

Post image
0 Upvotes

6 comments sorted by

33

u/Krenair Feb 28 '18 edited Feb 28 '18

I think that'll mostly be built-in modules and examples (including tests I guess) rather than the interpreter itself.

22

u/stefantalpalaru Feb 28 '18

No, it's not. Those in Python are mostly tests (Lib/tests) and included packages external to the interpreter (/Lib/*).

The interpreter's source code is in the "Python" subdirectory: https://github.com/python/cpython/tree/master/Python

0

u/r44_ Feb 28 '18

I always thought it was funny that the PyPy interpreter is written in python.

5

u/derpderp3200 An evil person Mar 01 '18

RPython*, an altogether different beast.

1

u/r44_ Mar 01 '18

This is what I get when using Quora as source, I should know better than to trust shady sources..

4

u/Kerbart Mar 01 '18

Not as funny as if it were written in Perl.