You are looking for the __str__ method. See http://docs.python.org/reference/datamodel.html#object.__str__ class Foo(): def __init__(self): pass def __str__(self) return "hello world!" -jeff