(obj, method, *args, **kwds)
| 46 | |
| 47 | |
| 48 | def _wrapfunc(obj, method, *args, **kwds): |
| 49 | bound = getattr(obj, method, None) |
| 50 | if bound is None: |
| 51 | return _wrapit(obj, method, *args, **kwds) |
| 52 | |
| 53 | try: |
| 54 | return bound(*args, **kwds) |
| 55 | except TypeError: |
| 56 | # A TypeError occurs if the object does have such a method in its |
| 57 | # class, but its signature is not identical to that of NumPy's. This |
| 58 | # situation has occurred in the case of a downstream library like |
| 59 | # 'pandas'. |
| 60 | # |
| 61 | # Call _wrapit from within the except clause to ensure a potential |
| 62 | # exception has a traceback chain. |
| 63 | return _wrapit(obj, method, *args, **kwds) |
| 64 | |
| 65 | |
| 66 | def _wrapreduction(obj, ufunc, method, axis, dtype, out, **kwargs): |
no test coverage detected
searching dependent graphs…