Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way in PyCharm to check an object's methods while debugging?

While debugging in PyCharm, it's easy to check an object's fields while execution is suspended. Is there a way to similarly check the object's methods from the IDE, or is this a feature that has just not been implemented by JetBrains? The builtin hasattr function checks for both, so one would think it would be an easy feature to implement in the IDE.

like image 752
Philip Dodson Avatar asked Jun 03 '15 19:06

Philip Dodson


1 Answers

I add dir(variablename) to the watch window to achieve this. If it's not visible, activate it with Alt+5 (or View/Tool Windows/Debug).

PyCharms Watches

Another option is to use "Evaluate Expression" (Alt+F8) and do the same

PyCharms Evaluate Expression

Using Community Edition 4.0.4 on Windows 7 SP1 x64 if that should matter.

like image 124
Thomas Weller Avatar answered Sep 28 '22 11:09

Thomas Weller