I am learning Python classes on my own right now and came across this page:
http://www.tutorialspoint.com/python/python_classes_objects.htm
The variable
empCount
is a class variable whose value would be shared among all instances of a this class. This can be accessed asEmployee.empCount
from inside the class or outside the class.
I'm assuming this is called a public variable? Or a static public variable?
Is this technically good practice? I know this question is a bit soft, but generally speaking when is it better to have a class variable like self.var (declared in the init or something) vs. a public variable like this?