Class search is resulting in file located outside of conda environment

When I double shift and try to find the source of bytearray, PyCharm is taking me to the following location,


I am using conda to manage my python environments. The active environment is in `py38` folder. For example, when I try to find the source of string class PyCharm takes me to,


Which is where I expect string class to reside as py38 is the active python environment.

So, why PyCharm is taking me to file that is not a part of my conda environment or py38 folder?

Comment actions Permalink

Hi, could you please provide a code example to reproduce the issue?

Comment actions Permalink

I am just learning python and using IntellijIDEA features to navigate python source file. There is no code in the project. I have opened an new project and with an empty file.



Comment actions Permalink

Ah, I see.

Bytearray is implemented in another language (C/C++). In this case, PyCharm generates python_stubs automatically, and use it for code completion and type checking., on the other hand, implemented in python, so PyCharm finds the actual module.

Is there any issue with this behavior?


Please sign in to leave a comment.