python中私有属性的访问
class MyClass(): def __init__(self): self.__superprivate = "Hello" self.__semiprivate = ", world!" mc=MyClass() print(mc._MyClass__semiprivate)
class MyClass(): def __init__(self): self.__superprivate = "Hello" self.__semiprivate = ", world!" mc=MyClass() print(mc._MyClass__semiprivate)