Repository: numpy/numpy
File: numpy/_core/_add_newdocs.py (Python)

Code before:
    (for speed) and linked into Python with NumPy's ufunc facility,
    Python's help() function finds this page whenever help() is called
    on a ufunc.

    A detailed explanation of ufuncs can be found in the docs for :ref:`ufuncs`.

    **Calling ufuncs:** ``op(*x[, out], where=True, **kwargs)``

    Apply `op` to the arguments `*x` elementwise, broadcasting the arguments.

    The broadcasting rules are:

    * Dimensions of length 1 may be prepended to either array.
    * Arrays may be repeated along dimensions of length 1.

    Parameters
    ----------
    *x : array_like
        Input arrays.
    out : ndarray, None, ..., or tuple of ndarray and None, optional
        Alternate array object(s) in which to put the result; if provided, it
        must have a shape that the inputs broadcast to. A tuple of arrays
        (possible only as a keyword argument) must have length equal to the
        number of outputs; use None for uninitialized outputs to be
        allocated by the ufunc.
        If ``out=...`` is passed, the output is guaranteed not to be an array
        and not a scalar.  This is useful when the result may be 0-D and
        especially when the result dtype is object.

        .. versionadded:: 2.3
            Support for ``out=...`` was added.

    where : array_like, optional
        This condition is broadcast over the input. At locations where the
        condition is True, the `out` array will be set to the ufunc result.
        Elsewhere, the `out` array will retain its original value.
        Note that if an uninitialized `out` array is created via the default
        ``out=None``, locations within it where the condition is False will
        remain uninitialized.
    **kwargs
        For other keyword-only arguments, see the :ref:`ufunc docs <ufuncs.kwargs>`.

    Returns
    -------
    r : ndarray or tuple of ndarray
        `r` will have the shape that the arrays in `x` broadcast to; if `out` is
        provided, it will be returned. If not, `r` will be allocated and
        may contain uninitialized values. If the function has more than one
        output, then the result will be a tuple of arrays.

    """)

Review comment (suggestion):
delete "not" after guaranteed!

Alternatively, maybe rewrite a little more so that the order is followed and that the text becomes more similar between the various methods:
```
        Location(s) into which the result(s) are stored.
        If not provided or None, new array(s) are created by the ufunc.
        If passed as a keyword argument, can be Ellipses (``out=...``) to
        ensure an array is returned even if the result is 0-dimensional,
        or a tuple with length equal to the number of outputs (where None
        can be used for allocation by the ufunc).
```

Code after:
    (for speed) and linked into Python with NumPy's ufunc facility,
    Python's help() function finds this page whenever help() is called
    on a ufunc.

    A detailed explanation of ufuncs can be found in the docs for :ref:`ufuncs`.

    **Calling ufuncs:** ``op(*x[, out], where=True, **kwargs)``

    Apply `op` to the arguments `*x` elementwise, broadcasting the arguments.

    The broadcasting rules are:

    * Dimensions of length 1 may be prepended to either array.
    * Arrays may be repeated along dimensions of length 1.

    Parameters
    ----------
    *x : array_like
        Input arrays.
    out : ndarray, None, ..., or tuple of ndarray and None, optional
        Location(s) into which the result(s) are stored.
        If not provided or None, new array(s) are created by the ufunc.
        If passed as a keyword argument, can be Ellipses (``out=...``) to
        ensure an array is returned even if the result is 0-dimensional,
        or a tuple with length equal to the number of outputs (where None
        can be used for allocation by the ufunc).

        .. versionadded:: 2.3
            Support for ``out=...`` was added.

    where : array_like, optional
        This condition is broadcast over the input. At locations where the
        condition is True, the `out` array will be set to the ufunc result.
        Elsewhere, the `out` array will retain its original value.
        Note that if an uninitialized `out` array is created via the default
        ``out=None``, locations within it where the condition is False will
        remain uninitialized.
    **kwargs
        For other keyword-only arguments, see the :ref:`ufunc docs <ufuncs.kwargs>`.

    Returns
    -------
    r : ndarray or tuple of ndarray
        `r` will have the shape that the arrays in `x` broadcast to; if `out` is
        provided, it will be returned. If not, `r` will be allocated and
        may contain uninitialized values. If the function has more than one
        output, then the result will be a tuple of arrays.

    """)