From 4b3f74fa3c450fb723ea32bc1581041305fdfe6a Mon Sep 17 00:00:00 2001 From: Kevin Sheppard Date: Sun, 25 Sep 2022 19:21:31 +0100 Subject: [PATCH] CLN: Remove overloads made redundant by deprecation --- pandas/core/arrays/categorical.py | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index ee995a0f9d0b7..7bb65e4e22625 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -841,17 +841,7 @@ def _set_dtype(self, dtype: CategoricalDtype) -> Categorical: return type(self)(codes, dtype=dtype, fastpath=True) @overload - def set_ordered( - self, value, *, inplace: NoDefault | Literal[False] = ... - ) -> Categorical: - ... - - @overload - def set_ordered(self, value, *, inplace: Literal[True]) -> None: - ... - - @overload - def set_ordered(self, value, *, inplace: bool) -> Categorical | None: + def set_ordered(self, value) -> Categorical: ... @deprecate_nonkeyword_arguments(version=None, allowed_args=["self", "value"]) @@ -893,11 +883,7 @@ def set_ordered( return None @overload - def as_ordered(self, *, inplace: NoDefault | Literal[False] = ...) -> Categorical: - ... - - @overload - def as_ordered(self, *, inplace: Literal[True]) -> None: + def as_ordered(self) -> Categorical: ... @deprecate_nonkeyword_arguments(version=None, allowed_args=["self"]) @@ -923,11 +909,7 @@ def as_ordered(self, inplace: bool | NoDefault = no_default) -> Categorical | No return self.set_ordered(True, inplace=inplace) @overload - def as_unordered(self, *, inplace: NoDefault | Literal[False] = ...) -> Categorical: - ... - - @overload - def as_unordered(self, *, inplace: Literal[True]) -> None: + def as_unordered(self) -> Categorical: ... @deprecate_nonkeyword_arguments(version=None, allowed_args=["self"])