TypeError: object not callable when making instance

Posted by TSM on Stack Overflow See other posts from Stack Overflow or by TSM
Published on 2012-10-08T03:25:45Z Indexed on 2012/10/08 3:36 UTC
Read the original article Hit count: 133

Filed under:

I've searched around other threads with similar questions, but I'm not finding the answer. Basically, I have a class:

import Android_Class

class Android_Revision(object):

    def __init__(self):
        # dict for storing the classes in this revision
        # (format {name : classObject}):
        self.Classes = {}
        self.WorkingClass = Android_Class()
        self.RevisionNumber = ''

    def __call__(self):  
        print "Called"

    def make_Class(self, name):
        newClass = Android_Class(name)
        self.Classes.update({name : newClass})
        self.WorkingClass = newClass

    def set_Class(self, name):
        if not(self.Classes.has_key(name)):
            newClass = Android_Class(name)
            self.Classes.update({name : newClass})
        self.WorkingClass = self.Classes.get(name)

I'm trying to make an instance of this class:

Revision = Android_Revision()

and that's when I'm getting the error. I'm confused because I have another situation where I'm doing almost the exact same thing, and it's working fine. I can't figure out what differences between the two would lead to this error. Thanks.

© Stack Overflow or respective owner

Related posts about python