Format the error message for when __array_ufunc__ gives up.
(dummy, ufunc, method, *inputs, **kwargs)
| 832 | return a // _gcd(a, b) * b |
| 833 | |
| 834 | def array_ufunc_errmsg_formatter(dummy, ufunc, method, *inputs, **kwargs): |
| 835 | """ Format the error message for when __array_ufunc__ gives up. """ |
| 836 | args_string = ', '.join([f'{arg!r}' for arg in inputs] + |
| 837 | [f'{k}={v!r}' |
| 838 | for k, v in kwargs.items()]) |
| 839 | args = inputs + kwargs.get('out', ()) |
| 840 | types_string = ', '.join(repr(type(arg).__name__) for arg in args) |
| 841 | return ('operand type(s) all returned NotImplemented from ' |
| 842 | f'__array_ufunc__({ufunc!r}, {method!r}, {args_string}): {types_string}' |
| 843 | ) |
| 844 | |
| 845 | |
| 846 | def array_function_errmsg_formatter(public_api, types): |