From 8191a8f8761369d0bc109e8f52f69add41722cd5 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Tue, 21 Apr 2020 20:07:05 +0100 Subject: [PATCH] TYP: remove #type:ignore from core.arrays.datetimelike --- pandas/core/arrays/datetimelike.py | 4 ++-- pandas/core/ops/common.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 27b2ed822a49f..3440df4b09c06 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -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[:] @@ -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[:] diff --git a/pandas/core/ops/common.py b/pandas/core/ops/common.py index 5c83591b0e71e..515a0a5198d74 100644 --- a/pandas/core/ops/common.py +++ b/pandas/core/ops/common.py @@ -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. @@ -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