On Wed, Apr 25, 2018 at 2:17 PM, Terry Reedy <tjre...@udel.edu> wrote: > On 4/25/2018 6:10 AM, Steve Holden wrote: >> Indeed, in the cases where I currently find myself unwrapping expressions >> to capture their values in local variables for debugging purposes it would >> usually be far less intrusive to bind a name to the expression inline, then >> use the debugger to inspect the value. > > > I agree that this is a definite plus feature. Being able to tag > subexpressions would make visual debuggers that show all local variables as > one steps (like IDLE's) even more useful relative to print statements.
Some other programming languages (thinking of Racket) solve this by having the debugger let you step through expression evaluation, without editing the code. e.g. in the line x = 1 + 2 * 3, we might step through and first evaluate 2*3 (-> 6), and then 1 + <result> (-> 7). Similar to how Python already lets you step into and see the result of function calls. This is especially powerful in visual debuggers, where the stepping and output can be displayed very intuitively. -- Devin _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com