Untitled

mail@pastecode.io avatar
unknown
python
23 days ago
403 B
1
Indexable
Never
_#!/usr/bin/env python
# -*- coding: utf-8 -*-


class Toto(object):
    def bouh(self):
        print("bouh toto")

    def __getattribute__(self, name):
        if name == "bouh":
            Toto.bouh(self)
        return super().__getattribute__(name)

class Tutu(Toto):
    def bouh(self):
        print("bouh Tutu")


def main():
    b = Tutu()
    b.bouh()

if __name__ == "__main__":
    main()
Leave a Comment