[Python-Dev] API design question: how to extend sys.settrace()? (original) (raw)
George King gwk.lists at gmail.com
Wed Sep 27 16:23:22 EDT 2017
- Previous message (by thread): [Python-Dev] API design question: how to extend sys.settrace()?
- Next message (by thread): [Python-Dev] API design question: how to extend sys.settrace()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Victor, thank you for starting this conversation. Nick, I just looked at your patch and I think it is a better solution than mine, because it does not involve adding to or changing the sys API. I will close my pull request.
The reason for my interest in this area is that I’m experimenting with a code coverage tool that does per-opcode tracing. I just updated it to use the new f_trace_opcodes feature and it almost worked: Nick’s implementation calls the opcode trace before updating the line number, whereas my version updated line numbers first, so the event stream is slightly different.
From my perspective it makes more sense to do the update to f_lineno first, followed by the opcode trace, because then line events and opcode events corresponding to the same opcode will have the same line number; as it is they come out different.
Is the current order intentional? Otherwise I’ll submit a patch.
Either way, I’m really happy that this functionality has made it into master!
Thanks, George
- Previous message (by thread): [Python-Dev] API design question: how to extend sys.settrace()?
- Next message (by thread): [Python-Dev] API design question: how to extend sys.settrace()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]