Get the real function object of the (possibly) wrapped object by :func:`functools.wraps`, or :func:`functools.partial`.
(obj)
| 217 | |
| 218 | |
| 219 | def get_real_func(obj): |
| 220 | """Get the real function object of the (possibly) wrapped object by |
| 221 | :func:`functools.wraps`, or :func:`functools.partial`.""" |
| 222 | obj = inspect.unwrap(obj) |
| 223 | |
| 224 | if isinstance(obj, functools.partial): |
| 225 | obj = obj.func |
| 226 | return obj |
| 227 | |
| 228 | |
| 229 | def getimfunc(func): |
no outgoing calls