Skip to content Skip to sidebar Skip to footer

How To Avoid Step Into Built-in Functions When Debugging In Pycharm?

For example: df = load_dataset(os.path.join(os.path.dirname(dataset), 'aclImdb')) I don't want to debug dirname and join, since they are Python built-in functions, but only want t

Solution 1:

It's possible to stop the debugger from stepping into library functions when you press Step intoF7 bu going to File>Settings>Build, Execution, Deployment>Debugger>Stepping>Python and checking the option Do not step into library scripts.

(One alternative could also be using Step into my codeAlt + Shift + F7).

As shown in the screenshot.

enter image description here

The following is a code example using only standard library that can be copied for testing

import os


defmy_function():
    return2


my_str = str(os.path.join(os.getcwd(), str(my_function())))

This screenshot shows using Step intoF7 having Do not step into library scripts unchecked and Always do smart step into checked.

enter image description here

Notice the 3 setting options are interconnected, if you choose Do not step into library scripts together with Always do smart step into the IDE will still give you a choice to step into the library function. If you uncheck the later option the above example will automatically step into your function.

Post a Comment for "How To Avoid Step Into Built-in Functions When Debugging In Pycharm?"