Does `functool.wraps` not do that for you?