Search code examples
cpython

what is Cpython is this single module or complete Python


I like to know what is CPython.

What I understood is

  1. Its flavor of python, (correct me if its wrong) so basically systems programming made easy in Python language but again I could not find system calls code in CPython implementation for mmap or etc. does CPython has sockets, listen, accept, send, and recvfrom system calls too for Cpython user developer.

  2. This is the link of Cpython https://github.com/python/cpython so if I install it then will my version already python version Python 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0] on linux will it continue working or do I need to make changes to that.

  3. Can I install any other module and run it in Cpython application?

Thanks for any info


Solution

  • CPython is the “official,” or reference implementation of Python. If you are installing python from python.org you are running Cpython implementation. You can confirm this via platform module.

    >>> import platform
    >>> platform.python_implementation()
    'Cpython'
    

    CPython contains complete implementation of the language(Including standard library/compiler/Byte Code Interpreter etc). If you want to understand how the source code is laid out you can refer Your Guide to the CPython Source Code.

    Additional reference: Python vs Cpython