Search code examples
pythondebuggingpycharm

tell pycharm to step over or skip functions during step in


Is there a way to tell PyCharm to skip over specific functions when doing a "step in" during debugging python code? For instance if I have a method somewhere like this:

def getHost(self):
  return self.host

And then elsewhere I have a function call

self.buggyFunction(thing.getHost())

There is no way to "step in" to this function without first stepping throuth getHost(). Thanks.


Solution

  • I know this is an old question, but there is still no answer given.

    This site describes a way (albeit indirectly) to skip stepping into custom functions when debugging your project, because what worked in the Spyder IDE (__debuggerskip__=True) doesn't work in CLion.

    So the way: you need to find the debugging settings (in CLion 2024 it is Settings -> Build, Excution, Deployment -> Debugger) and in the Stepping section check the 'Do not step into scripts:' checkbox and specify the path to the script using the Plus button (for example, */script.py). Although this mechanism works only at the file level, this way suits me personally.