Inheritance problem ?
googlenews at tooper.org
Wed Aug 24 12:34:36 CEST 2005
I'm trying to implement a common behavior for some object that can be
read from a DB or (when out of network) from an XML extract of this DB.
I've then wrote 2 classes, one reading from XML & the other from the
DB, both inheritating from a common one where I want to implement
several common methods.
Doing this, I've come to some behaviour I can't explain to myself,
which I've reproduced in the example bellow :
return "\t a="+self.a+"\n\t b="+self.b
return "Undefined for mychilda"
return "Undefined for mychildb"
I was expecting to get :
b= Undefined for mychilda
a= Undefined for mychildb
but I get the following error :
File "/home/thierry/mytest.py", line 20, in ?
TypeError: 'str' object is not callable
Could someone explain me what I missed ?
Thanks in advance !
More information about the Python-list