4 ms·
A simply utility script which allows you to analyze your Python file
- stereo 2y agoAn example in the readme would be quite helpful.
- mraza007 2y agoHello, I’m the author here. I have added the output in the README.
- JohnKemeny 2y agoThis has potential! Could be interesting to use type hints to output types of variables and functions when they exist. How does the script deal with shadowed variables and variable names that occur different places?
- mraza007 2y agoWell thank you for the feedback. I didn’t really think of that use case, Are you talking about if the variable is being imported into different files
- JohnKemeny 2y agoI'm thinking if you have two functions a and b and they both define a variable x. Then it will say "x used on lines 7, 10", but it's not the same variable, it's just the same name. Perhaps you could either call the variable a:x and b:x (that is, x defined in functions a and b, respectively), or you could write l6:x (x as defined on line 6). Ps, the function is called "index.py", but your error message says "analyzer.py". Pps, you should upload it to pypi, it's not so hard, and it makes it a ton easier.
- icelancer 2y agoThis is nice! Something we could hack into a Github Action workflow in combination with our internal LLMs we use for code analysis.
- xtiansimon 2y ago> “… which allows you to analyze your python file.” My code or someone else’s code? I see stats about imports, vars, classes, functions—I know what my code does if I wrote it, no? I don’t get the use case. That said, I am interested in how I can more quickly learn other people’s code—structure, what’s a main process and what’s supporting.