Python中的单下划线和双下划线
Python中单下划线和双下划线 1 2 3 4 5 6 7 8 9 10 11 12 13 14 >>> class MyClass(): ... def __init__(self): ... self.__superprivate = "Hello" ... self._semiprivate = ", world!" ... >>> mc = MyClass() >>> print mc.__superprivate Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: myClass instance has no attribute