Open Jaymon opened 6 years ago
It would be cool if you could also do something like get dumped into a shell, something like:
pout.d()
and at the line that pout.d()
is called it will dump the script into a shell where you can look at local values and things like that.
Inspired by: http://blogs.perl.org/users/toby_inkster/2014/08/datadumper-debugging.html
also look at tracemalloc
import tracemalloc
tracemalloc.start()
snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics('lineno')
print("[ Top 10 ]")
for stat in top_stats[:10]:
print(stat)
https://docs.python.org/3/library/trace.html
I was able to get it to run on a test like this:
$ python -m trace --listfunc --module pyt <TESTNAME>
Could this be useful for something?
would this be something I should add to pout?