From 3a346fbab3605a074499505ceb1d9682e034345c Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Mon, 2 Dec 2019 16:01:40 +0000 Subject: [PATCH] TYPE: some types for pandas/core/arrays/base.py --- pandas/core/arrays/base.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index bf50d6e9b50e7..dc1a23e83f981 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -451,7 +451,9 @@ def _values_for_argsort(self) -> np.ndarray: # Note: this is used in `ExtensionArray.argsort`. return np.array(self) - def argsort(self, ascending=True, kind="quicksort", *args, **kwargs): + def argsort( + self, ascending: bool = True, kind: str = "quicksort", *args, **kwargs + ) -> np.ndarray: """ Return the indices that would sort this array. @@ -467,7 +469,7 @@ def argsort(self, ascending=True, kind="quicksort", *args, **kwargs): Returns ------- - index_array : ndarray + ndarray Array of indices that sort ``self``. If NaN values are contained, NaN values are placed at the end. @@ -1198,10 +1200,9 @@ def _maybe_convert(arr): if op.__name__ in {"divmod", "rdivmod"}: a, b = zip(*res) - res = _maybe_convert(a), _maybe_convert(b) - else: - res = _maybe_convert(res) - return res + return _maybe_convert(a), _maybe_convert(b) + + return _maybe_convert(res) op_name = ops._get_op_name(op, True) return set_function_name(_binop, op_name, cls)