class function tostring pyhton code example Example: python class tostring def __str__(self): return "foo"