Python access to object as a function (not __call__)
<p>I want to do the following: I have a container-class Container, it has 
attribute attr, which refers to another class OtherClass. </p>

<pre><code>class OtherClass:
    def __init__(self, value): 
        self._value = value 

    def default(self): 
        retirn self._value 

    def another(self): 
        return self._value ** 2 

    def as_str(self): 
        return 'String: %s' % self._value

class Container: 
    def __init__(self, attr): 
        self.attr = OtherClass(attr)</code></pre>

<p>I want to: </p>

<pre><code>x = Container(2) 

x.attr # when accessing the attribute - return value from default method
2 
x.attr.another() # but also an attribute can be treated as an object 
4 
x.attr.as_str()
'String: 2'
</code></pre>

<p>How can I do this?</p>
