Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:
        *,
        keepdims: bool | _NoValueType = ...,
    ) -> Any: ...
    @overload
    def argmax(  # type: ignore[override]
        self,
        axis: SupportsIndex | None = None,
        fill_value: _ScalarLike_co | None = None,
        *,
        out: _ArrayType,
        keepdims: bool | _NoValueType = ...,
    ) -> _ArrayType: ...
    @overload
    def argmax(  # type: ignore[override]
        self,
        axis: SupportsIndex | None,
        fill_value: _ScalarLike_co | None,
        out: _ArrayType,
        *,
        keepdims: bool | _NoValueType = ...,
    ) -> _ArrayType: ...

    #
    def sort(
        self,
        axis: SupportsIndex | None = None,
        kind: _SortKind | None = None,
        order: str | Sequence[str] | None = None,
        endwith: bool | None = None,
        fill_value: _ScalarLike_co | None = None,
        *,
        stable: bool | None = None,
    ) -> None: ...
    @overload
    def min(  # type: ignore[override]
        self: _MaskedArray[_SCT],
        axis: None = None,
        out: None = None,
        fill_value: _ScalarLike_co | None = None,
        keepdims: Literal[False] | _NoValueType = ...,
    ) -> _SCT: ...
    @overload
    def min(  # type: ignore[override]
        self,
        axis: _ShapeLike | None = None,
        out: None = None,
        fill_value: _ScalarLike_co | None = None,
        keepdims: bool | _NoValueType = ...
    ) -> Any: ...
    @overload
    def min(  # type: ignore[override]

Review comment (suggestion):
The docs lie:

```py
>>> import numpy as np
>>> m = np.ma.array([[3, 1], [2, 4]])
>>> m.sort(None)
Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    m.sort(None)
    ~~~~~~^^^^^^
  File "/home/joren/.pyenv/versions/3.13.2/lib/python3.13/site-packages/numpy/ma/core.py", line 5895, in sort
    ndarray.sort(self, axis=axis, kind=kind, order=order)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object cannot be interpreted as an integer
```

At runtime it defaults to `-1`, so this should be

```suggestion
        axis: SupportsIndex = -1,
```

Code after:
        fill_value: _ScalarLike_co | None = None,
        out: None = None,
        *,
        keepdims: bool | _NoValueType = ...,
    ) -> Any: ...
    @overload
    def argmax(  # type: ignore[override]
        self,
        axis: SupportsIndex | None = None,
        fill_value: _ScalarLike_co | None = None,
        *,
        out: _ArrayType,
        keepdims: bool | _NoValueType = ...,
    ) -> _ArrayType: ...
    @overload
    def argmax(  # type: ignore[override]
        self,
        axis: SupportsIndex | None,
        fill_value: _ScalarLike_co | None,
        out: _ArrayType,
        *,
        keepdims: bool | _NoValueType = ...,
    ) -> _ArrayType: ...

    #
    def sort(
        self,
        axis: SupportsIndex = -1,
        kind: _SortKind | None = None,
        order: str | Sequence[str] | None = None,
        endwith: bool | None = True,
        fill_value: _ScalarLike_co | None = None,
        *,
        stable: Literal[False] | None = False,
    ) -> None: ...

    # 
    @overload
    def min(  # type: ignore[override]
        self: _MaskedArray[_SCT],
        axis: None = None,
        out: None = None,
        fill_value: _ScalarLike_co | None = None,
        keepdims: Literal[False] | _NoValueType = ...,
    ) -> _SCT: ...
    @overload
    def min(  # type: ignore[override]
        self,
        axis: _ShapeLike | None = None,
        out: None = None,
        fill_value: _ScalarLike_co | None = None,