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

Code before:
        summarized (i.e., multiple elements replaced with ``...``).

        If set to ``'2.2'``, the transition to use scientific notation for
        printing ``np.float16`` and ``np.float32`` types may happen later or
        not at all for larger values.

        If set to `False`, disables legacy mode.

        Unrecognized strings will be ignored with a warning for forward
        compatibility.

        .. versionchanged:: 1.22.0
        .. versionchanged:: 2.2

    override_repr: callable, optional
        If set a passed function will be used for generating arrays' repr.
        Other options will be ignored.

    See Also
    --------
    get_printoptions, printoptions, array2string

    Notes
    -----

    * `formatter` is always reset with a call to `set_printoptions`.
    * Use `printoptions` as a context manager to set the values temporarily.
    * These print options apply only to NumPy ndarrays, not to scalars.

    Examples
    --------
    Floating point precision can be set:

    >>> import numpy as np
    >>> np.set_printoptions(precision=4)
    >>> np.array([1.123456789])
    [1.1235]

    Long arrays can be summarised:

    >>> np.set_printoptions(threshold=5)
    >>> np.arange(10)
    array([0, 1, 2, ..., 7, 8, 9], shape=(10,))

    Small results can be suppressed:

    >>> eps = np.finfo(float).eps
    >>> x = np.arange(4.)
    >>> x**2 - (x + eps)**2
    array([-4.9304e-32, -4.4409e-16,  0.0000e+00,  0.0000e+00])
    >>> np.set_printoptions(suppress=True)

Review comment (suggestion):
```suggestion
    * ``formatter`` is always reset with a call to `set_printoptions`.
```

This is a preexisting issue but let's just fix it.

Code after:
        summarized (i.e., multiple elements replaced with ``...``).

        If set to ``'2.2'``, the transition to use scientific notation for
        printing ``np.float16`` and ``np.float32`` types may happen later or
        not at all for larger values.

        If set to `False`, disables legacy mode.

        Unrecognized strings will be ignored with a warning for forward
        compatibility.

        .. versionchanged:: 1.22.0
        .. versionchanged:: 2.2

    override_repr: callable, optional
        If set a passed function will be used for generating arrays' repr.
        Other options will be ignored.

    See Also
    --------
    get_printoptions, printoptions, array2string

    Notes
    -----

    * ``formatter`` is always reset with a call to `set_printoptions`.
    * Use `printoptions` as a context manager to set the values temporarily.
    * These print options apply only to NumPy ndarrays, not to scalars.

    Examples
    --------
    Floating point precision can be set:

    >>> import numpy as np
    >>> np.set_printoptions(precision=4)
    >>> np.array([1.123456789])
    [1.1235]

    Long arrays can be summarised:

    >>> np.set_printoptions(threshold=5)
    >>> np.arange(10)
    array([0, 1, 2, ..., 7, 8, 9], shape=(10,))

    Small results can be suppressed:

    >>> eps = np.finfo(float).eps
    >>> x = np.arange(4.)
    >>> x**2 - (x + eps)**2
    array([-4.9304e-32, -4.4409e-16,  0.0000e+00,  0.0000e+00])
    >>> np.set_printoptions(suppress=True)