Jaymon / pout

Python pretty print on steroids
MIT License
29 stars 0 forks source link

pdb #29

Open Jaymon opened 6 years ago

Jaymon commented 6 years ago
import pdb; pdb.set_trace()

would this be something I should add to pout?

Jaymon commented 5 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

Jaymon commented 4 years ago

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)
Jaymon commented 3 years ago

Cyberbrain via Cyberbrain: Python debugging, redefined

Jaymon commented 1 month ago

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>
Jaymon commented 3 weeks ago

Could this be useful for something?

https://docs.python.org/3/library/dis.html