xxxxxxxxxx
# Python does not have any private variables like C++ or Java does.
# You could access any member variable at any time if wanted, too.
# However, you don't need private variables in Python,
# because in Python it is not bad to expose your classes member variables.
xxxxxxxxxx
# Make variables private by adding two underscored (_)
# in front of variable names.
# However, this is ***JUST A CONVENSION***.
# Private variables doesn't exist in Python. __var is still accesible.
# Example:
class User(object):
def __init__(self, name, password):
self.name = name # Public variable
self.__password = password # Private variable