TypeError: object is not callable

Gustaf Liljegren gustafl at algonet.se
Wed Jun 6 20:43:10 EDT 2001


Why this error?

I have done a class which is in placed in a directory within sys.path, and 
the class works as intended when I test it by adding some main() code in 
it. But when I call it from another module I get this strange error 
"TypeError: object is not callable". No way I can get the same error in 
Idle...

>From the docs, it seems that it has something to do with the constructor, 
so here is the constructor:

class Friend:
  def __init__(self, id, file):
    self.id = id
    self.name = ""
    self.emails = []
    self.file = file
    self.load()

Regards,

Gustaf Liljegren



More information about the Python-list mailing list