Where is the source code for Python3 commands located?

0

Where is the source code for Python3 commands? I want to see the source code for commands like len() , count() , find() , etc etc. I use Linux Mint, I already looked and looked, but I do not think ...

Who can help thank you!

    
asked by anonymous 27.01.2018 / 22:45

1 answer

1

The source code for CPython 3 is in this repository . You probably can not figure out why you have only compiled Python installed, which does not include the source code (CPython, main interpreter, is written in C).

Pros built-in objects, functions like len are defined in the code in C. For example, give Ctrl + F by searching for "list_length" in source for a list .

If you have a Python class that defines the __len__ function, then this will be the function used by Python to figure out the object's size, but this is not the case for built-ins written in C. >     

27.01.2018 / 23:45