class MyClass: def __init__(self): self.__field = 123 def __method(self): print("this is private method 2.") c = MyClass() # {instance}._{ClassName}__{private_member_name} の書式でアクセスできてしまう print(str(c._MyClass__field)) c._MyClass__method() # ふつうに参照するとエラーになる #print(str(c.__field)) #c.__method()