Normally, I use IntelliJ for python programming. But sometimes I don't have access to it or just to make a quick edit I open a Python file in a text editor.
At those times, it is really difficult to find the namespace of a class. I am googling it. But it takes time. Is there a better way to do this?
Edit: Looking at the responses, I noticed that my question was not very clear.
I need to find the namespace of a class at coding time, not in runtime. Therefore, introspection methods like using inspect
or __module__
doesn't help me.
WildSeal suggests using online doc. This is good but it is only useful for Python's standard libraries. I want to search all the modules installed in my current Python path. This is easy with IntelliJ. It has already indexed all the files.
I tried to use grep
to search for the class inside the site-packages
directory. But it takes a lot of time to search all the files, probably since they have not been indexed.