title: where is the default __str__ function located in python?
body: <p>I was trying to understand the class and objects in python and this question pops up in my mind. I was guessing that the default <code>__str__</code> function is defined inside of the object class. All the user defined classes and built-in classes are subclasses of the object class. That's why they can have accesses to the default <code>__str__</code> function. If you do not like the default <code>__str__</code> function, you can override it by defining your own <code>__str__</code> function in the class function defined by yourself. Did I understand it correctly? Any comments are greatly appreciated. </p>