[wingide-users] Re: breakpoint at pass statement
avner at skilldesign.com
Tue Mar 16 16:32:47 MDT 2010
> Tom Stambaugh wrote:
>> In the following fragment of code, a breakpoint set at the "pass" is
>> often skipped:
>> answer = self.someReturnValue()
>> # do stuff here
>> if aVariable is None:
>> someVariable = self.doSomething()
>> return answer
>> A breakpoint set at the "if" statement works as expected, as does a
>> breakpoint set at the "return" statement. I'd like to break at the
>> "pass" statement so that I can inspect local state before I write code
>> that will go there.
>> Am I misunderstanding what "pass" does, or is this a bug?
> "pass" generates no byte codes so the line is never executed and thus
> the debugger can't stop there.
> If I remember correctly, this may vary by Python version.
I have been inserting conditional pass statements for years. just for
the purpose of breakpoint, (before there were conditional breakpoints),
and it has always worked!
That's Python 2.5 and 2.6 under Windows.
Actually, I have only used pass after if. I have never tried it after
else or elif.
More information about the wingide-users