为什么属性名字(score)和__score可以不一样呢?
class Person(object): def __init__(self, name, __score): self.name = name self.__score = __score
感觉写成这样才对吧?
self.__score = score self.__score = __score
这两种有没有区别呢?
class Person(object): def __init__(self, name, __score): self.name = name self.__score = __score
感觉写成这样才对吧?
self.__score = score self.__score = __score
这两种有没有区别呢?
2015-04-01
举报