As you said, a large chunk of python is written in C but these are not included with the distribution. So you can not read the source from your IDE. These are mostly compiled sources which means only the bytecode is used by the Interpreter. Not all the functions are written in C, most of it is actually written in pure python.
One way to view source is through terminal by using ipython.
In [10]: import string
In [11]: string.lower??
Signature: string.lower(s)
Source:
def lower(s):
"""lower(s) -> string
Return a copy of the string s converted to lowercase.
"""
return s.lower()
File: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/string.py
Type: function
In [12]: import os
In [13]: os.system??
Docstring:
system(command) -> exit_status
Execute the command (a string) in a subshell.
Type: builtin_function_or_method
Alternatively you can find what you want, by using inspect.getsource().
import inspect
import os
print (inspect.getsource(os))
# You should see the source code here
As in the above examples, this doesn't work for some built in functions.
To check what is written in C, you should use the other way which is to check this link which is the official repository for the python interpreter. Most of the object types are listed in the cpython/Objects folder. For instance, this is the implementation of list object in C, and for the builtin modules refer this one.
I believe this is what you want. Do comment if you need help.
splitmethod ofstrclass is becausesplitmethod is implemented in c?str.split()are not so easily mapped to the source code. What you see instead is the PyCharm internal representation of those objects, there only to help autocompletion and inline help.