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