Unexpected behavior in PythonWin Debugger

Stefan Franke spamfranke at bigfoot.de
Mon May 10 10:53:30 EDT 1999


>cmedcoff at my-dejanews.com wrote in message <7gvrvl$6dd$1 at nnrp1.deja.com>...
>>Consider the following.
>>
>>import sys
>>for x in sys.argv:
>> print x
>>
>>Debug the following script with the arguments "foo on you". When you press
>>the "step" button on the line "print x" it steps into the function.  When
>you press "step out" the loop runs and you see all output and program
>termination. This is not what I would expect.  Shouldn't the function all
>return and one can continue to step through the loop iteration?

On Sat, 8 May 1999 09:49:03 +1000, "Mark Hammond" <MHammond at skippinet.com.au>
wrote:

>There is a strange thing when debugging the bottom( ie, only!) stack frame -
>if you put the code into a function, it should step fine (as the function is
>no longer at the bottom.  

Is this really his problem? I would say "Step out" works as it should: Stepping
out of the current function, which is the top level script. So it runs to its
end.

Chuck, I don't understand clearly what you are expecting in this situation (BTW:
How do you invoke the debugger?). Stepping over the code should toggle the
current line between "for x in.." and "print x" as long as sys.argv is. Stepping
out is meant to leave to current function. Just try it with some nested function
calls.

Stefan





More information about the Python-list mailing list