Jan-18-2018, 07:32 PM
Instead of
The reasoning being that Second uses
if_over
inheriting from all three other classes, it should only inherit from Third
, which in turn extends Second
, which then extends First
.The reasoning being that Second uses
self.x
, which is only defined in First, and Third uses self.z
, which is only defined in Second. So those classes should extend from what they need, so they can be used by themselves. Your code, as it is, will never work if you try to create an object of any class EXCEPT if_over
. Ideally, each piece of the chain will work, and the next piece adds more, instead of the bottom piece being the only usable one.