Untitled
unknown
python
a year ago
403 B
6
Indexable
_#!/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()
Editor is loading...
Leave a Comment