Skip to main content
Tweeted twitter.com/StackSoftEng/status/1527710774608777224
added 8 characters in body; edited title
Source Link
Alexander
  • 5.2k
  • 1
  • 25
  • 28

Why does PythonCPython has both C and .python versions of modules?

The CPython implementation seems to have the same modules written both in C (e.g., datetimedatetime in .c.c) and also in .py for the same module (e.g., datetimedatetime in .py.py).

My question is which version is used when I use datetime in my .py file when using the CPython interpreter? And why are there two module versions in the first place?

Why does Python has both C and .python versions of modules?

The CPython implementation seems to have the same modules written both in C (e.g., datetime in .c) and also in .py for the same module (e.g., datetime in .py).

My question is which version is used when I use datetime in my .py file when using the CPython interpreter? And why are there two module versions in the first place?

Why does CPython has both C and .python versions of modules?

The CPython implementation seems to have the same modules written both in C (e.g., datetime in .c) and also in .py for the same module (e.g., datetime in .py).

My question is which version is used when I use datetime in my .py file when using the CPython interpreter? And why are there two module versions in the first place?

Source Link

Why does Python has both C and .python versions of modules?

The CPython implementation seems to have the same modules written both in C (e.g., datetime in .c) and also in .py for the same module (e.g., datetime in .py).

My question is which version is used when I use datetime in my .py file when using the CPython interpreter? And why are there two module versions in the first place?