0

I am using anaconda in Windows os, I am trying to realize the structure of the whole python environment.

For example, I want to check the implementation file of the module itertools. However, when I take a look into the folder which path is anaconda3/envs/my_envs/Lib there's no any python file named itertools.py.

How can I find the exactly file that contained all these implementations code from docs.python.org

Jet C.
  • 126
  • 8
  • How to find: open the interpreter, import the desired module, type the imported module's name, press Return. The output will tell you where to find it. – Klaus D. Nov 12 '21 at 06:35

1 Answers1

2

You can refer the Cpython source code which is the “official,” or reference implementation of Python. Some of the standard library modules are implemented in C(For the purpose of speed/system calls/library bindings) and itertools is one among them. You can find the itertools.permutations implementation here.

If you want to understand how the source code is structured you can refer Your Guide to the CPython Source Code. To understand C extension structure and how to create your own refer Extending Python with C or C++

Abdul Niyas P M
  • 18,035
  • 2
  • 25
  • 46
  • does that mean some of the standard modules are already converted into c binary files or c library, etc? – Jet C. Nov 12 '21 at 07:44