Python Skill Series | Data Hiding | Name Mangling

preview_player
Показать описание
An object's attributes may or may not be visible outside the class definition. You need to name attributes with a double underscore prefix, and those attributes then are not directly visible to outsiders. #PythonSkillSeries #DataHiding

(Feel free to give or ask for any recommendation)
Рекомендации по теме
Комментарии
Автор

I don't think this is the right way to do this. The whole point of hidden variables is that they ARE NOT accessible. Presumably you would use and accessor function to get at them if you need to. But the idea of them being hidden is that you aren't supposed to access them directly.

jwcnmr