Philip Dodson
Philip Dodson

Reputation: 343

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.

Upvotes: 5

Views: 2426

Answers (1)

Thomas Weller
Thomas Weller

Reputation: 59303

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.

Upvotes: 7

Related Questions