I have the following python class:
class uf_node:
def __init__(self, Vertex):
self.vertex = Vertex
self.rep = Vertex
def set_rep(self, Rep):
self.rep = Rep
Now, at the interpreter I do the following:
>>> from uf_node import *
>>> u = uf_node('a')
>>> u
<uf_node.uf_node instance at 0x7f56069ca758>
Can one get better output, perhaps creating something like a 'toString()' function that would automatically be called when you try to print the object?