python supplement

 

There are four main python named:
1, object # public methods
2, _object # semi-protected
                 # Is seen as "protect", meaning that only the class and subclass object objects they can access these variables,
                  Can not be used outside the module or class is not used 'from module import *' import.
                # __Object to avoid name conflicts for subclasses, the identifier for the method described herein, the parent
                  Methods of the class can not override the method easily quilt class, their name is actually
                  _classname__methodname。
3, _ _ object # full private, full protection
                       # Private members "private", meaning that only he can access the object class, subclass object can not even visit
                          Asked this data, you can not use 'from module import *' import.
4, _ _ object_ _ # built-in method, the user should not be so defined

Guess you like

Origin www.cnblogs.com/dalton/p/11812181.html