[wingide-users] Strange debugger behaviour

Charles Hartman charles.hartman at conncoll.edu
Thu Jun 30 07:31:43 EDT 2005


On Jun 30, 2005, at 5:25 AM, Luc Bourhis wrote:

> When I execute the following snippet in the debugger
>
> def f(a):
>     if a > 0:
>         pass
>     else:
>         return 1
>
> a = f(1)
>
> the run marker eventually goes on “pass”, which is fine, but then  
> jump onto “return 1”, which


This threw me too at first. It isn't jumping to the line "return 1"  
-- it's jumping to _the end of the routine_. No matter what path the  
marker has followed thro9ugh the function, it always makes a last  
stop on the last line. Sometimes it's confusing, as in the case you  
wrote. It has one big advantage, though: it lets you check variable  
values just before you leave the function.

Charles Hartman

> is very surprising!! Hitting step over again immediately jumps out  
> of the routine contrary to what would have happened if that if  
> branch had been taken.
>
> I am running Wing IDE Professional 2.0.2-1 Patches 03 on MacOS 10.4  
> with the System python (i.e. 2.3.5).
>
> Thanks,
>
> Luc Bourhis
> Software Engineer
> Chemical Crystallography Laboratory
> University of Durham, UK
>
> _________________________________________________
> Wing IDE users list
> http://wingware.com/lists/wingide

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/wingide-users/attachments/20050630/10499953/attachment.htm


More information about the wingide-users mailing list