Skip to content

Commit 2e55bff

Browse files
authored
STYLE: fix pylint consider-merging-isinstance warnings (#49686)
1 parent e7b044c commit 2e55bff

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

pandas/_testing/asserters.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -571,20 +571,12 @@ def raise_assert_detail(
571571

572572
if isinstance(left, np.ndarray):
573573
left = pprint_thing(left)
574-
elif (
575-
isinstance(left, CategoricalDtype)
576-
or isinstance(left, PandasDtype)
577-
or isinstance(left, StringDtype)
578-
):
574+
elif isinstance(left, (CategoricalDtype, PandasDtype, StringDtype)):
579575
left = repr(left)
580576

581577
if isinstance(right, np.ndarray):
582578
right = pprint_thing(right)
583-
elif (
584-
isinstance(right, CategoricalDtype)
585-
or isinstance(right, PandasDtype)
586-
or isinstance(right, StringDtype)
587-
):
579+
elif isinstance(right, (CategoricalDtype, PandasDtype, StringDtype)):
588580
right = repr(right)
589581

590582
msg += f"""

pandas/core/indexes/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,7 @@ def _get_default_index_names(
16481648
from pandas.core.indexes.multi import MultiIndex
16491649

16501650
if names is not None:
1651-
if isinstance(names, str) or isinstance(names, int):
1651+
if isinstance(names, (int, str)):
16521652
names = [names]
16531653

16541654
if not isinstance(names, list) and names is not None:

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ disable = [
101101

102102
# pylint type "R": refactor, for bad code smell
103103
"comparison-with-itself",
104-
"consider-merging-isinstance",
105104
"consider-using-ternary",
106105
"consider-using-with",
107106
"cyclic-import",

0 commit comments

Comments
 (0)