As far as I remember, in IntelliJ, the debug window has the option to view the toString() of an object instead of its memory address. Is there a way to do this in PyCharm with an object's __str__(self)?
As far as I remember, in IntelliJ, the debug window has the option to view the toString() of an object instead of its memory address. Is there a way to do this in PyCharm with an object's __str__(self)?
This should be done with __repr__:
class Foo:
def __repr__(self):
return 'foo object'
f = Foo()
pass # breakpoint here
This shows 'foo object' in the debugger's variables window.
Pycharm in variable view / debugging is showing __str__ object representation instead of __repr__.
Here was created a work-item on JetBrains website. Unforunetally I think there is still no progress.