Closed
Description
Feature or enhancement
Adapt pdb/bdb to PEP669
Pitch
After #103082, we will have the chance to build a much faster debugger. For breakpoints, we do not need to trigger trace function all the time and checking for the line number. Other optimizations for commands like return
are available too.
The bad news is - it's almost impossible to do a completely backward compatible transition because the mechanism is quite different.
There are a couple of ways forward:
- Create a new basic debugger based on the new mechanism. Leave
bdb
as it is and redesignpdb
to use the new base debugger. Encourage users to migrate to the new base debugger while keep supportingbdb
.
- pro: no historical burden, clean usage
- con: new module, potential duplicate code
- Work on top of the current
bdb
, provide two ways to trigger the debugger. User can choose whether to use the oldset_trace
or the new mechanism.
- pro: incremental change, no new modules, reuse of the existing code
- con: the code could be messy, there will be two sets of APIs living in the same class with potential conflict
- Just change
bdb
starting 3.12 to use the new mechanism and let users worry about their own tools built upon it.
- pro: code reuse still exists, life is much easier, enjoy the speed up immediately
- con: may not be an option
- Leave everything there to use the old way.
- pro: no work need to be done at all
- con: no benefit from PEP 669 at all
- Some other great idea that I did not think of
Previous discussion
https://peps.python.org/pep-0669/