Skip to content

CLN: Remove overloads made redundant by deprecation #48773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down Expand Up @@ -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"])
Expand All @@ -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"])
Expand Down