diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2021-05-20 13:04:03 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-20 13:04:03 -0600 |
commit | 5c19c2350a9d839db835540e52697ea79c52ce47 (patch) | |
tree | 670bb4a0d0b60f3d40b7a44ffe09cc60a2c2b4d0 /numpy/core/_internal.py | |
parent | 4732c242e2d9ef649f1aa71b261e51068a9b41a9 (diff) | |
parent | 81f528ae968830fc837543b2741786ba699a2d3c (diff) | |
download | numpy-5c19c2350a9d839db835540e52697ea79c52ce47.tar.gz |
Merge pull request #19052 from BvB93/ufunc
ENH: Improve the `np.ufunc` annotations
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r-- | numpy/core/_internal.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py index 4eebbaea3..3b0c46467 100644 --- a/numpy/core/_internal.py +++ b/numpy/core/_internal.py @@ -843,11 +843,13 @@ def _ufunc_doc_signature_formatter(ufunc): ", order='K'" ", dtype=None" ", subok=True" - "[, signature" - ", extobj]" ) + + # NOTE: gufuncs may or may not support the `axis` parameter if ufunc.signature is None: - kwargs = ", where=True" + kwargs + kwargs = f", where=True{kwargs}[, signature, extobj]" + else: + kwargs += "[, signature, extobj, axes, axis]" # join all the parts together return '{name}({in_args}{out_args}, *{kwargs})'.format( |