__getattr__ in a class Demo : Class getattr « Class « Python






__getattr__ in a class Demo

class TT:
    def __getattr__(self, name): 
       return 23
import sys
sys.modules[__name__] = TT()



           
       








Related examples in the same category

1.__getattr__ demo__getattr__ demo