in Python, a single double underline is used as a variable prefix and suffix to specify the meaning of a particular variable :
_name cannot be imported with ' from Moduleimport * '
__name__ System Definition Name
Private variable names in the __xxx class because underscores have special meaning to the interpreter, and the symbolic variable name used by the built-in identifier _xxx is considered "private" and is not available outside the module or class. It's a good habit to use _xxx to represent variables when the variables are private. Because the variable name XXX has a special meaning for python, you should avoid this naming style for ordinary variables. The member variable that begins with a single underline is called a protection variable, meaning that only class objects and subclass objects can access these variables. A "double underline" is a private member, meaning that only the class object can access it, and even the subclass object cannot access the data. A class attribute that is not directly accessible by the representative of the beginning of a single underline (_FUNC). Access is required through the interfaces provided by the class, and cannot be imported with the "from name import *"; (func) that begins with a double underscorerepresents a private member of the class; a double underline beginning and ending (__foo represents a particular method-specific identifier in Python, such as init(),del(), and new , which represents the constructor of the class.
1. _name cannot be used for ' from module import ' with a single underline that represents a variable of type protected. That is, the protection type can only allow access to itself with subclasses.
2, the __name double underline is a variable of the private type. Can only be allowed to access the class itself. It is not possible to even subclass.
3,name_ definition is the Special column method. Like init,del or something.