1
eriale 2014 年 8 月 10 日
为什么会有这种情况?python中对象自己的属性是不会共享的。
class A(): def __init__(self): self.lst = [] |
2
lll9p 2014 年 8 月 11 日
在Python里,类变量通常在内部被当做字典来处理并遵循通常所说的方法解析顺序(Method Resolution Order (MRO))。
看这里: http://blog.jobbole.com/68256/ |
3
magine 2014 年 8 月 11 日
如一楼所写的那样,把列表初始化放在构造函数中,而不是类空间中。
|
4
yueyoum 2014 年 8 月 11 日
LZ 先去补一补 面向对象知识
|