0

Data hiding question in python course

The first question on the subsection data hiding of the python course is referencing on what is presented only later in the next description. This means you can't answer the first question by reading the introducing description.

6th Jun 2017, 5:24 PM
Blech
2 Réponses
+ 3
"private methods and attributes, which block external access to certain methods and attributes in a class. The Python philosophy is slightly different. It is often stated as "we are all consenting adults here" [...].Hence there are no ways of enforcing a method or attribute be strictly private" The answer of the question is not written directly in this text, but by understanding this text you can find the answer of the question. You can discourage people from accessing something in your class but you can't be sure they will obey.
6th Jun 2017, 5:33 PM
Glozi30
Glozi30 - avatar
+ 1
The most important sentence for me was: "Hence there are no ways of enforcing a method or attribute be strictly private." So I was a little confused. In the next description it came out to be more clear.
6th Jun 2017, 5:47 PM
Blech