taizilongxu / interview_python

关于Python的面试题
16.63k stars 5.55k forks source link

”类变量和实例变量“的参考链接有误 #11

Open Mithrilwoodrat opened 8 years ago

Mithrilwoodrat commented 8 years ago

可以看看下面的例子:

class Person: name=[]

p1=Person() p2=Person() p1.name.append(1) print p1.name # [1] print p2.name # [1] print Person.name # [1] 参考:http://stackoverflow.com/questions/6470428/catch-multiple-exceptions-in-one-line-except-block

参考链接和这个问题无关。

ghost commented 7 years ago

我也发现了,链接是py2 py3 exception写法问题

taizilongxu commented 7 years ago

找了一圈是在没找到, 找到了这个 http://stackoverflow.com/questions/8701500/python-class-instance-variables-and-class-variables

MarineJoker commented 5 years ago

刚准备提来着,github这issue功能有点好