widget = widget or self.widget if isinstance(widget, type): widget = widget() else: widget = copy.deepcopy(widget)