4 ms·
Since Python 3.7 import pdb pdb.set_trace() can be written as just breakpoint()
by rowanseymour 3y ago
Since Python 3.7
import pdb
pdb.set_trace()
can be written as just
breakpoint()
- agumonkey 3y agoI was told that at my job, but my fingers are so used to type `pdb` and emacs template-replacing it that I can't change.
- shpx 3y agoConfigure Emacs to template-replace it with breakpoint()
- erikvdven 3y agoThanks for the tip! :)
- IshKebab 3y agoAnd this also works with Debugpy so you can actually use a proper debugger and not pdb which is frankly terrible.
- masklinn 3y agoThat's not entirely true, because `breakpoint` is a more general hook, `pdb.set_trace` is just its default behaviour. This is, if anything, better. Because that way you can e.g. replace stray `breakpoint()` calls by warnings rather than break production :D