(An Unofficial) Python Reference Wiki

"clearly marked experimental"

str

str([object])

Returns a string containing a nicely printable representation of an object. For strings, this returns the string itself. The difference with repr(object) is that str(object) does not always attempt to return a string that is acceptable to eval; its goal is to return a printable string. If no argument is given, returns the empty string, ''.

To make this function work on your own classes, implement the __str__ method.