matt at mondoinfo
Jun 6, 2001, 6:00 PM
Post #2 of 4
On 7 Jun 2001 00:43:10 GMT, Gustaf Liljegren <gustafl [at] algonet>
>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:
> def __init__(self, id, file):
> self.id = id
> self.name = ""
> self.emails = 
> self.file = file
It's hard to be sure what the problem is without seeing an example
that fails but if the problem in in the constructor, it seems likely
that it's in the last line since that's the only place that you're
trying to call something. If self.load is something other than a
method there, you'll get the error message you mention. You might try
printing self.load (note no parentheses) just before that line.