Feel confused about naming rules of variables and functions in python
Created by: pkuyym
As we all know,functions or variables named like __init__、__del__
etc. are built-in entities in python. Generally speaking, it's not a good idea to name our own functions or variables at the same way. But I find some python codes disobey such rules, is that allowed in paddle's naming rules?
For example, code snippet in python/paddle/v2/optimizer.py:
def __create_local_updater__(self):
return swig_api.ParameterUpdater.createLocalUpdater(self.__opt_conf__)
def __create_remote_updater__(self, pass_num, use_sparse_updater):
return swig_api.ParameterUpdater.createRemoteUpdater(
self.__opt_conf__, pass_num, use_sparse_updater)