class MyCls: c_var = "class" # ã³ã³ã¹ãã©ã¯ã¿ def __init__(self): self.i_var = "inst" # ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ãã def i_method(self): pass # ã¯ã©ã¹ã¡ã½ãã @classmethod def c_method(cls): pass # ã¹ã¿ãã£ãã¯ã¡ã½ãã @staticmethod def s_method(): pass my_inst = MyCls() print my_inst.__dict__ print MyCls.__dict__ å®è¡çµæ {'i_var': 'inst'} {'c_var': 'class', '__module__': '__main__', 'c_method': <classmethod object at 0x02719ED0>, 'i_method'
{{#tags}}- {{label}}
{{/tags}}