0

In c++ the object of derived class can access method of base class like this.

class a:
    def save(self):
        print('a executed')


class b(a):
    def save(self):
        print('b executed')


class c(a):
    def save(self):
        print('c executed')


class d(b, c):
    def save(self):
        print('d executed')


obj = d()

Is this possible in python that obj of class d can access the method of class c. I'm not discussing about use of super(). e.g., if some syntax like this

obj.c.save() #not correct its just my thinking 

then output should be:

c executed
Harrish Kumar
  • 116
  • 3
  • 10

1 Answers1

0

In python you should use super or do something like this:

c.save(obj)
Gabriel E.
  • 51
  • 2