Ask your own question, for FREE!
MIT 6.01SC Introduction to Electrical Engineering and Computer Science I 11 Online
OpenStudy (anonymous):

Did anyone read the chapter 3 of course notes? There seems to be a mistake in the codes in 3.5.5, P85: ... def SubclassOfFoo(Foo): def bar(self, arg): Foo.bar(self, arg) ... I think it should be "class SubclassOfFoo(Foo):", as function doesn't have a self. Do I wrong?

OpenStudy (anonymous):

Yes, I agree with you. With the subclass we are adding or overriding a method of the class Foo. So we have to define a new subclass of Foo: class SubClassOfFoo(Foo). Definig a new function as it is defined in the notes we are using the class as parameter, but we arn't using the inheritance property of the subclasses.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!