-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pdb.main is unnecessarily complicated #88720
Comments
While investigating bpo-44461, I observed some complexities to the current pdb.main implementation, some of which likely contributed to the bug being present.
These factors mean that all of these lines of code are entangled in ways that are somewhat difficult to reason about. For example, it's unclear what states have been achieved by the time A functional or OO approach would limit the amount of mutation and entanglement (through encapsulation or scoping). An OO approach would have a protocol or interface that captures the different behaviors required prior to and on invocation of For example, the PDB "targets" (script or module) could be modeled as separate classes and provide symmetric interfaces with (possibly degenerate) equivalent operations for each use-case. To be sure, the code that's present is adequate and in my opinion right on the border of benefiting from a more rigorous abstraction. The current imperative approach is fairly readable and mostly comprehensible. It's only because of the surprise behavior in the reported issue that I propose to step back and contemplate ways to alleviate the concerns above. |
Additional problems I noticed while working on the refactor:
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: