|
From: <Ron...@Ne...> - 2001-05-03 17:31:17
|
I have the following situation, which strikes me as bizarre:
file Ab.py:
---------------
class AB :
def handleCommand (self, cmd) :
print "AB.handleCommand()"
file fred.py:
----------------
from AB import AB
class fred (AB) :
def handleCommand (self, cmd) :
print "fred.handleCommand()"
file C.py:
from AB import AB
from fred import fred
class C (fred) :
def handleCommand (self, cmd) :
if blahBlah : <<========= is false
fred.handleCommand(self, cmd)
else :
AB.handleCommand(self, cmd)
Ok. Everything has been running fine for "months"; I see
"AB.handleCommand()" in
the output, just as is desired.
Today I just happened to notice that module AB was used in the import
statements and not module Ab. I'm a freak about details, so I changed
the imports to say module Ab and not AB. Now the code breaks with a
traceback
saying: "TypeError: unbound method must be called with class instance 1st
argument"
I changed the imports back
to say module AB, and all works again.
What is happening - my brain feels like it's leaking.
|