This project has moved. For the latest updates, please go here.

Debugger Variable View in Locals

Sep 5, 2012 at 8:36 AM


While Debugger using the Python Debugger, I often have to see which values are inside my class instances.

In the Locals view I can see the name of an instance variable, the value and the type

But the value for the instance variable if always 

<__main__,MyClass instance at 000000013245679 >

How can I change this, to see something else ?

in C# I have to override the ToString() method.

Can I do the same thing in Python ?

Sep 5, 2012 at 3:10 PM

In Python you can override the __str__ and __repr__ methods for this. This question on Stack Overflow covers it pretty well: