python类
摘要:一般来说,实例变量用于对每一个实例都是唯一的数据,类变量用于类的所有实例共享的属性和方法: 1 class Dog(object): 2 kind = 'canine' #类变量用于类的所有实例共享的变量 3 def __init__(self,name): 4 self.name = name #
阅读全文
posted @ 2016-04-26 14:34
posted @ 2016-04-26 14:34
posted @ 2016-04-15 14:23
posted @ 2016-04-11 15:08
posted @ 2016-04-11 14:58