News for hackers. Stuff that matters.
Re:Implementing Rust's dbg! in Python by azkae on Friday December 11, 2020 @11:40AM (#25387646)
I use icecream [1] for the same purpose while debugging. It's really handy.

[1] https://github.com/gruns/icecream

Re:Implementing Rust's dbg! in Python by memco on Friday December 11, 2020 @02:13PM (#25389489)
Thanks for sharing! I like that ic includes a hook for logging, which I think is an advantage over calling print directly. I realize for a lot of examples, they’re quick and dirty but I almost always end up setting up a logger with an stderr or stdout handler so that other handlers can also send it to a file if desired. This makes it easier to run these in production on daemons and such where your code might not have an stdout to print to.