There is no real "private" in Python, and the visibility of the properties of a class depends on the name of the property (the property here includes the function). For example, attributes that start with a single underscore (for example , _spam) should be treated as non-public parts of the API (but note that they can still be accessed), which is generally the part of the specific implementation details. Single underline is commonly used for module-level privatization, and when we use "frommymodule import *" to load modules, module properties that begin with a single underscore are not loaded.
Attributes that start with a double underscore and end with a maximum of one underscore (for example, ___spam) will be replaced with _classname__spam, where ClassName is the class name of the current class. Knowing this, we still have access to Python 's private functions
The meaning and effect of single underline and double underline in Python