5

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 to debug user defined functions like load_dataset.

Is there a way to control that in PyCharm?

0

1 Answer 1

5

It's possible to stop the debugger from stepping into library functions when you press Step into F7 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 code Alt + 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


def my_function():
    return 2


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

This screenshot shows using Step into F7 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.