Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm not recognizing new class method without reload

Tags:

python

pycharm

I think this is a really silly / dumb question, but I am using PyCharm and constantly adding methods to a class or changing the body of the methods. When I test the class by importing the .py file and initiating the class object, it doesnt seem to recognize the changes to the class.

Is there some button I need to hit to make sure that the class code is changed.

The only thing that seems to work for me is to restart PyCharm.

like image 329
theStud54 Avatar asked Dec 13 '25 02:12

theStud54


1 Answers

When you import the class, it imports it as-is at the current time. If you make changes after that, you need to import it again. In this case, you should just be able to terminate the shell, and start it again.

This is not an error, or a bug.

like image 54
Inbar Rose Avatar answered Dec 14 '25 14:12

Inbar Rose



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!