human
Here's a good function header given the following:
I wrote the below code

    class UndoCommand(QUndoCommand, ):
        def __init__(self, widget, val):
            QUndoCommand.__init__(self)
            self.widget = weakref.ref(widget)
            if hasattr(widget, u'dateTime'):
                self.undo_val = widget.dateTime()
            elif hasattr(widget, u'value'):
                self.undo_val = widget.value()
            if (isinstance(val, date) and (not isinstance(val, datetime))):
                val = parse_only_date(val.isoformat(), assume_utc=False, as_utc=False)
            self.redo_val = val
        def undo(self):
            w = self.widget()
            if hasattr(w, u'setDateTime'):
                w.setDateTime(self.undo_val)
            elif hasattr(w, u'setValue'):
                w.setValue(self.undo_val)
        def redo(self):
            w = self.widget()
            if hasattr(w, u'setDateTime'):
                w.setDateTime(self.redo_val)
            elif hasattr(w, u'setValue'):
                w.setValue(self.redo_val)
    class UndoableSpinbox(spinbox, ):
        def __init__(self, parent=None):
            spinbox.__init__(self, parent)
            self.undo_stack = QUndoStack(self)
            (self.undo, self.redo) = (self.undo_stack.undo, self.undo_stack.redo)
        def keyPressEvent(self, ev):
            if (ev == QKeySequence.Undo):
                self.undo()
                return ev.accept()
            if (ev == QKeySequence.Redo):
                self.redo()
                return ev.accept()
            return spinbox.keyPressEvent(self, ev)
        def contextMenuEvent(self, ev):
            m = QMenu(self)
            if hasattr(self, u'setDateTime'):
                m.addAction(((_(u'Set    date    to    undefined') + u' DCTB ') + QKeySequence(Qt.Key_Minus).toString(QKeySequence.NativeText)), (lambda : self.setDateTime(self.minimumDateTime())))
            m.addAction((_(u'&Undo') + access_key(QKeySequence.Undo)), self.undo).setEnabled(self.undo_stack.canUndo())
            m.addAction((_(u'&Redo') +...

What's a good function header?
assistant
#Here's a good function header.

def make_undoable(spinbox):