Manish Kumar Singh
Manish Kumar Singh

Reputation: 183

Inheritance of class in Python?

Suppose I have a parent class A and a daughter class B. Now A has 10 methods in it and B requires only three of those methods. How can this be done?

Upvotes: 0

Views: 51

Answers (1)

Karpov
Karpov

Reputation: 423

There is nothing special to do.

Just inherit class A:

class B(A):
    super(B, self).__init__():

Use/override the methods you need and ignore the rest.

Upvotes: 1

Related Questions