Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ def __rsub__(self, other):

return -(self - other)

def __iadd__(self, other): # type: ignore
def __iadd__(self, other):
result = self + other
self[:] = result[:]

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

def __isub__(self, other): # type: ignore
def __isub__(self, other):
result = self - other
self[:] = result[:]

Expand Down
6 changes: 4 additions & 2 deletions pandas/core/ops/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
Boilerplate functions used in defining binary operations.
"""
from functools import wraps
from typing import Callable

from pandas._libs.lib import item_from_zerodim
from pandas._typing import F

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


def unpack_zerodim_and_defer(name: str):
def unpack_zerodim_and_defer(name: str) -> Callable[[F], F]:
"""
Boilerplate for pandas conventions in arithmetic and comparison methods.

Expand All @@ -21,7 +23,7 @@ def unpack_zerodim_and_defer(name: str):
decorator
"""

def wrapper(method):
def wrapper(method: F) -> F:
return _unpack_zerodim_and_defer(method, name)

return wrapper
Expand Down