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

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

posted @ 2017-01-25 16:00  小聪傻大  阅读(8250)  评论(0编辑  收藏  举报