widget = widget or self.widget if isinstance(widget, type): widget = widget() else: widget = copy.deepcopy(widget)
判断类或对象方法
原文:https://www.cnblogs.com/Fmaj7/p/13150586.html