Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdb #29

Open
Jaymon opened this issue Jun 18, 2018 · 5 comments
Open

pdb #29

Jaymon opened this issue Jun 18, 2018 · 5 comments

Comments

@Jaymon
Copy link
Owner

Jaymon commented Jun 18, 2018

import pdb; pdb.set_trace()

would this be something I should add to pout?

@Jaymon
Copy link
Owner Author

Jaymon commented Jan 22, 2019

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
Copy link
Owner Author

Jaymon commented Nov 20, 2019

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
Copy link
Owner Author

Jaymon commented Dec 10, 2020

@Jaymon
Copy link
Owner Author

Jaymon commented May 7, 2024

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
Copy link
Owner Author

Jaymon commented Jun 4, 2024

Could this be useful for something?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant