Is there any way to make certain variables in classes “private” (or whatever self.__var really is) but be accessible to another class, like friends in c++, except in python? I do not want the variables in either class being messed with. Nor do I want to copy the entire code over and convert it for the second class.
Is there any way to make certain variables in classes private (or whatever self.__var
Share
No, there is not such an option.
Use names that start with single underscores and tell the other people working on your project to not be silly about what they access.