Mark Roseman added the comment:

Regarding the nested loops, what's happening is:
- IDLE tells interpreter to run program
- Interpreter now has control and is running program, start to end
- Because execution is being traced, before every statement we get a callback

If we didn't use the nested loop and just returned back immediately after we're 
called, the program would go onto the next statement, and the next one, etc. 
(it's in control).

Instead, we block to force the program to wait until we do something, at which 
point it continues to the next statement, after possibly modifying the 
conditions under which the execution traces fire.

If instead, we tell the execution tracing to actually stop on every statement 
(rather than running through start to end), we'll get a callback for each 
statement (to update our display), but can decide to stay stopped, or 
immediately continue on, based on whether we last did single-step, in/out, go, 
etc. That way it is more event-based: we don't need the nested event loop to 
'block' the program from running.

Totally agree on your suggestions (speed setting, and whether or not to show 
where we are outside our own code).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25146>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to