Similar to other tools, it would be nice when developing CPython to have a good mechanism for debugging.
I think it would be nice to have a --debug flag that when passed, prints something like this
Debug Mode
PID XXXX
Press any key to continue...
Then, people could copy the PID and paste it into any debugger, profiler, etc that supports it. I think having the program be executed until after the PID is copied can also be useful.
I think having a builtin way of doing this can be very useful to people wanting to get started in making contributions, or simply learning how Python works.
I am not aware if there are similar tools doing this, or if something similar has been proposed/rejected (if it has, would love to learn about it)
If you want to debug your Python program, use pdb. But if the process is already running, it can just print os.getpid() at some point which you can then attach to with a third-party debugger (pdb also has this attaching capability). But Python already has some good built-in profiling tools, so I don’t really see the utility of this.
Yes, I think pdb or os.getpid are more helpful for those cases. Sorry, I meant to debug python itself rather than other programs.
E.g., if I run the REPL and want to know the call chain, or profile the import mechanism, etc.