jeudi 24 octobre 2019

Python: get overridden functions of subclass

Is there a way to get all overriden functions of a subclass in Python?

Example:

class A:
    def a1(self):
        pass

    def a2(self):
        pass


class B(A):
    def a2(self):
        pass

    def b1(self):
        pass

Here, I would like to get a list ["a2"] for an object of class B (or for the class object itself) since class B overrides only a single method, namely a2.

Any help is much appreciated.





Aucun commentaire:

Enregistrer un commentaire