Skip to content

Commit bfb1dd1

Browse files
committed
Actually addressed mypy typing
1 parent df51168 commit bfb1dd1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pandas/plotting/_matplotlib/core.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,13 +1932,16 @@ def _make_plot(self, fig: Figure) -> None:
19321932
_stacked_subplots_ind: dict[int, int] = {}
19331933
_stacked_subplots_offsets = []
19341934

1935-
if self.subplots != False & self.stacked:
1936-
sub_range = range(len(self.subplots)) # type:ignore[arg-type]
1935+
self.subplots: list[Any]
1936+
if self.subplots:
1937+
subplots_flag = 1
1938+
else:
1939+
subplots_flag = 0
1940+
1941+
if subplots_flag & self.stacked:
1942+
sub_range = range(len(self.subplots))
19371943
ss_temp = {
1938-
# mypy thinks self.subplots is a bool :(
1939-
x: self.subplots[x] # type:ignore[index]
1940-
for x in sub_range
1941-
if len(self.subplots[x]) > 1 # type:ignore[index]
1944+
x: self.subplots[x] for x in sub_range if len(self.subplots[x]) > 1
19421945
}
19431946
for k, v in ss_temp.items():
19441947
for x in v:

0 commit comments

Comments
 (0)