Untitled

mail@pastecode.io avatar
unknown
plain_text
12 days ago
405 B
2
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