Skip to content

Commit 8400646

Browse files
committed
mypy happiness
1 parent b99f779 commit 8400646

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas-stubs/_libs/tslibs/period.pyi

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import datetime
2+
import sys
23
from typing import (
34
Literal,
45
TypeAlias,
@@ -94,8 +95,13 @@ class Period(PeriodMixin):
9495
def __add__(self, other: Index) -> PeriodIndex: ...
9596
# Ignored due to indecipherable error from mypy:
9697
# Forward operator "__add__" is not callable [misc]
97-
@overload
98-
def __radd__(self, other: _PeriodAddSub) -> Self: ...
98+
if sys.version_info >= (3, 11):
99+
@overload
100+
def __radd__(self, other: _PeriodAddSub) -> Self: ...
101+
else:
102+
@overload
103+
def __radd__(self, other: _PeriodAddSub) -> Self: ... # type: ignore[misc]
104+
99105
@overload
100106
def __radd__(self, other: NaTType) -> NaTType: ...
101107
# Real signature is -> PeriodIndex, but conflicts with Index.__add__

0 commit comments

Comments
 (0)