HNHacker News
TopNewBestAskShowJobs

gaogaotiantian

41 karma · joined September 15, 2020

submissionscomments
gaogaotiantian··on Show HN: Watchpoints, an easy to use watchpoints equivalent library for Python
By default, you'll write this debug code piece in your program and it will print to console. However, you can design your own callback so it can work whatever way you like.

Also I already implemented the pdb hook so this could work like breakpoint() in built-in library.

gaogaotiantian··on Show HN: Watchpoints, an easy to use watchpoints equivalent library for Python
I'm not on twitter, but I do have a twitter account for my other project viztracer @viztracer. All my work is on my github if you are interested :)

watchpoints does not work in the REPL. REPL is a more complicated environment. I don't think pdb will work in REPL either.

watchpoints works very intuitively. It has some dirty magic that made it work in some way that you need but not expect.

gaogaotiantian··on Show HN: Watchpoints, an easy to use watchpoints equivalent library for Python
lol, thank you for the attention. Yes this will incur a performance penalty, and is similar to what "pdb" introduces(if your are familiar with pdb). Most of the python debugger did single step or breakpoint feature in this way.

And it's a little more than inspect and frames. Note that it is much easier to do watch("a") than watch(a), but it's slightly less intuitive. So I also did some AST hack to make watch(a) possible :)