Python is so dynamic that itโs not always clear what happens in a large program, and finding a tiny piece of source code does not always help. Worse, editors tend to have poor navigation support for the definitions of tokens or import statements in a Python file.
One of the methods of compensation may be to write a special profiler, which, instead of synchronizing the program, would record the types of time and paths of program objects and display this data in the editor.
Can this be implemented with sys.settrace (), which sets a callback for each line of code and how pdb is implemented, or using the ast module and the import hook for the code tool, or is there a better strategy? How would you write something like this without making it incredibly slow and without triggering extreme dynamism, for example, do the parties affect access to property?
source
share