python 类方法中参数使用默认值的方法

时间:2022-02-02 16:12:22
class A():
__init__(self, **arg):
self.__dict__.update(arg)
       def M(self, config=None, section=None):
             if config is None:
                  config = self.config
             if section is None:
                  section = self.section
 
 
 
来源:https://www.zhihu.com/question/22959976/answer/23246445