Skip to content

Commit cf61be6

Browse files
TYP: remove #type:ignore from core.arrays.datetimelike (#33705)
1 parent 89e85cf commit cf61be6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pandas/core/arrays/datetimelike.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ def __rsub__(self, other):
15321532

15331533
return -(self - other)
15341534

1535-
def __iadd__(self, other): # type: ignore
1535+
def __iadd__(self, other):
15361536
result = self + other
15371537
self[:] = result[:]
15381538

@@ -1541,7 +1541,7 @@ def __iadd__(self, other): # type: ignore
15411541
self._freq = result._freq
15421542
return self
15431543

1544-
def __isub__(self, other): # type: ignore
1544+
def __isub__(self, other):
15451545
result = self - other
15461546
self[:] = result[:]
15471547

pandas/core/ops/common.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
Boilerplate functions used in defining binary operations.
33
"""
44
from functools import wraps
5+
from typing import Callable
56

67
from pandas._libs.lib import item_from_zerodim
8+
from pandas._typing import F
79

810
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries
911

1012

11-
def unpack_zerodim_and_defer(name: str):
13+
def unpack_zerodim_and_defer(name: str) -> Callable[[F], F]:
1214
"""
1315
Boilerplate for pandas conventions in arithmetic and comparison methods.
1416
@@ -21,7 +23,7 @@ def unpack_zerodim_and_defer(name: str):
2123
decorator
2224
"""
2325

24-
def wrapper(method):
26+
def wrapper(method: F) -> F:
2527
return _unpack_zerodim_and_defer(method, name)
2628

2729
return wrapper

0 commit comments

Comments
 (0)