Aug-07-2021, 05:46 PM
I am trying to read python source for some built in function/classes, but sometimes PyCharm is taking me to an autogenerated stub file which makes me think that the source might be written in C.
For example, when I try to get to the source of int(), PyCharm take me to this file,
Image link: https://imgur.com/a/EYvFmyu
The file location in the PyCharm title bar tells me that it is an autogenerated file.
I know that cpython source is available at https://github.com/python/cpython, but it's hard to know where to find the source of a particular python function/class.
So my question is, where is the C source for int() class? And is there any well known guide out there for someone who is trying to connect python function/classes with corresponding cpython source?
For example, when I try to get to the source of int(), PyCharm take me to this file,
Image link: https://imgur.com/a/EYvFmyu
The file location in the PyCharm title bar tells me that it is an autogenerated file.
I know that cpython source is available at https://github.com/python/cpython, but it's hard to know where to find the source of a particular python function/class.
So my question is, where is the C source for int() class? And is there any well known guide out there for someone who is trying to connect python function/classes with corresponding cpython source?