Mimicking functionality of built-in types
<p>I am curious if there is a way to mimic the same kind of functionality as built-in types with custom classes. The best way to explain what I am looking for is with an example.</p>

<pre><code>class MyClass(object):

    def __init__(self, val):
        self._returnVal = val

myObject = MyClass('test')
print myObject
</code></pre>

<p>Rather than the above code returning:</p>

<pre><code>&lt;__main__.MyClass object at 0x023861F0&gt;
</code></pre>

<p>Is there a way to get it so when we call on the object it automatically returns self._returnVal, but also still allows us to call the methods that exist on myObject?</p>
