Let’s say I have this code sample:
function1(
'arg1',
'arg2',
function2(
'arg3.1',
'arg3.2',
),
)
According to pdb’s documentation, I can step into a function by typing s. Pressing s at the first line does not have the desired effect however, it merely passes control to the subsequent line.
How can I step into function1, without stepping into function2?
Each line is presented as a separate expression, pdb will step into a function right after evaluating the last expression before the closing parenthesis.
You cannot prevent stepping into
function2; step in, straight out withr, then usesto step intofunction1whenfunction2has returned. If you were to step overfunction2instead (when the line witharg3.2is presented) you’d step over bothfunction2andfunction1in one go instead.