I'm a little confused about an inheritance problem in python.
I know the following example is "stupid" but I simplify my initial problem.
Imagine we have 3 classes
class testT(object):
def check(self, str):
return "t" in str
class testTE(testT):
def check(self, str):
return "e" in str
class testTES(testTE):
def check(self, str):
return "s" in str
And I would like an output like :
>>> print testTES().check("test")
>>> True (Because string "test" contains "s","e" and "t" characters)
>>> print testTES().check("dog")
>>> False
>>> print testTES().check("dogs")
>>> False (Contains a "s" but no "e" and no "t")
>>> print testTE().check("tuple")
>>> True (Contains "e" and "t")
How can I implement this behavior ? I tried with 'super' but my method wasn't successfull.
Thanks for your help