Re:Icecream: Never use print() to debug again in Python
by masklinn on Tuesday March 30, 2021 @05:41AM
(#26632703)
You can run Python with
PYTHONBREAKPOINT=print python
and all your breakpoint() calls will be prints.
Which is not super useful, however you can use
PYTHONBREAKPOINT=icecream.ic
and now you get the advantages of TFA without having to import anything anywhere.
The only annoyance is that the default hook takes no arguments, so you can't trivially switch between the default and custom implementations, you may need to modify the source depending on the breakpoint hook you're using.
Which is not super useful, however you can use
and now you get the advantages of TFA without having to import anything anywhere.The only annoyance is that the default hook takes no arguments, so you can't trivially switch between the default and custom implementations, you may need to modify the source depending on the breakpoint hook you're using.