object not callable python when parsing a json response
Question: I have a response from a URL which is of this format.

    
    
    'history': {'all': [[u'09 Aug', 1,5'],[u'16 Aug', 2, 6]]}
    

And code is :

    
    
    response = urllib.urlopen(url)
    data = json.loads(response.read())
    print data["fixture_history"]['all']
    customObject = MyObject (
                               history = data["history"]['all']
                            )
    

Printing works but in my custom class I am seeing this error :

    
    
        history = data["history"]['all']
    TypeError: 'module' object is not callable
    

My class is :

    
    
    class MyObject:
        #init
        def _init_(self,history):
            self.hstory = history
    


Answer: > Printing works but in my custom class I am seeing this error : TypeError:
> 'module' object is not callable

I bet your your class is defined in a module named `MyObject.py` and that you
imported it as `import MyObject` instead of `from MyObject import MyObject`,
so in your calling code, name `MyObject` is bound to the module, not the
class.

