As a purely hypothetical application, this could be one way:
class Super: @classmethod def do_something(cls): print('Super doing something') class Child(Super): def __init__(self): self.do_something = lambda: print('Child Doing Something')
Example:
>>> obj = Child() >>> obj.do_something() Child Doing Something >>> Child.do_something() Super doing something >>> obj.do_something() Child Doing Something
source share