Re:Object Oriented Programming in Python: Encapsulation and ...
by metaobject on Sunday September 24, 2017 @01:12PM
(#15325541)
I agree. He is 100% wrong when he says:
"This is the main difference between public and private variables. We can’t direct access or set a new value out of our class."
He should just start off by saying that there are no private methods or variables, but instead a naming convention should be used to discourage users of the class from accessing them directly.
"This is the main difference between public and private variables. We can’t direct access or set a new value out of our class."
He should just start off by saying that there are no private methods or variables, but instead a naming convention should be used to discourage users of the class from accessing them directly.