trio
trio copied to clipboard
Debugging / introspection features
For quality of life:
- [x] A method on
Taskto get a traceback - [ ] Ability to introspect set of all tasks (compare to thread iteration APIs)
- [ ] Give a task, quickly summarize what it's going. Curio has its "status" field. I don't like the manual bookkeeping this requires, and I think we can do better. Idea: walk the task's stack to find the innermost frame with a
__trio_wchan__local (or whatever), and report it as the wchan-equivalent. It could even be callable to get more details (e.g.run_in_worker_threadcould set it to print the repr of the call being run). Or I guess we'd get something similar by just showing the name+arguments of the frame. - [ ] An async REPL that provides little utilities based on things like the above to see what's going on in your program.
-
Task#iter_await_frames - not done yet
- not done yet, also https://github.com/python-trio/trio/issues/3079
- there's an async REPL but once 3.14 is out we can add remote execution (via
sys.remote_exec) and that should satisfy this
Will there be something similar to the new asyncio pstree?
That's https://github.com/python-trio/trio/issues/413 and IMO it shouldn't be in trio itself (ie not included in the thing I mentioned in 4). But it's on the list of things I want to do!