[Python-ideas] breakpoint(): print(*args, **kwargs) before entering pdb

Zachary Ware zachary.ware+pydev at gmail.com
Fri Mar 2 14:45:00 EST 2018


On Fri, Mar 2, 2018 at 12:00 PM, Carl Bordum Hansen <carl at bordum.dk> wrote:
> I played around with a newer Python build, but when using the new
> `breakpoint` builtin, I missed my weapon of choice: dirty print-debugging.
>
> I suggest we combine forces and make the default `sys.breakpointhook`
> forward *args and **kwargs to print before entering pdb.

You can do this for yourself by adding the following to
sitecustomize.py or similar:

import sys

def printingbreakpointhook(*args, **kwargs):
    print(args, kwargs)
    return sys.__breakpointhook__()

sys.breakpointhook = printingbreakpointhook


-- 
Zach


More information about the Python-ideas mailing list