Version of inspect.getargspec that works with partial and warps.
(func)
| 639 | |
| 640 | |
| 641 | def getargspec(func): |
| 642 | """Version of inspect.getargspec that works with partial and warps.""" |
| 643 | if isinstance(func, functools.partial): |
| 644 | return getargspec(func.func) |
| 645 | |
| 646 | func = getattr(func, "__wrapped__", func) |
| 647 | if isinstance(func, type): |
| 648 | return inspect.getfullargspec(func.__init__) |
| 649 | else: |
| 650 | return inspect.getfullargspec(func) |
| 651 | |
| 652 | |
| 653 | def takes_multiple_arguments(func, varargs=True): |
no outgoing calls
searching dependent graphs…