I am trying to improve a set of python files written by a co-worker. There are many scripts and each script calls all the functions and classes from other files
from file1.py import *
from file2.py import *
...
And at times it gets complicated to figured out where the functions are defined. Is there a short way to find the location of functions? And also their definitions? Also, if possible, where a variable is being used? I use VSCode.
from ... import *is frowned upon. As you figure out, for example, thatfoocomes fromfile1, do one of two things: 1) addfrom file1 import foo, or 2) addimport file1and usefile1.foo. Once you are sure you have accounted for everything fromfile1, get rid offrom file1 import *altogether.ModuleNotFoundErrorforfile1.py? I'm not sure that's the proper syntax there... I would have usedimport file1 as f1. But I digress. VSCode should have "Go to definition" and "Go to references" in the context menu when you right click on the functions.