class MyClass:
"""A simple example class"""
i = 12345
def f(self):
return 'hello world'
另一句话:
一般来说,实例变量用于每个
实例和类变量用于属性和方法
类的所有实例:
class Dog:
kind = 'canine' # class variable shared by all instances
def __init__(self, name):
self.name = name # instance variable unique to each instance