Demo entry 6718120

c1234

   

Submitted by anonymous on Mar 02, 2018 at 03:20
Language: Python 3. Code size: 324 Bytes.

'''定义类'''
class D:
    a= 'abc'  
    def __init__(self):
        self.b = 2
    def __getattribute__(self, *args, **kwargs):  
        print("__getattribute__() is called")  
        return object.__getattribute__(self, *args, **kwargs)  
    def __getattr__(self, name):  
        print(self)
        print(name)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).