functools.wraps has exactly the same problem -- crashes if the wrapped function is a functools.partial =(