Data Hiding in Python Class

后端 未结 4 1368
半阙折子戏
半阙折子戏 2021-01-02 09:07

I know that the attributes of class which are declared by double underscore __ prefix may or may not visible outside the class definition. As we can still acces

4条回答
  •  攒了一身酷
    2021-01-02 09:31

    Nope, since it's part of the name, you can't do that.

    Well, actually you can through hacking with the getters/setters, but you generally shouldn't.

提交回复
热议问题