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