Skip to content

Commit 9f32b93

Browse files
committed
TYP: fix mypy errors in pandas/core/arraylike.py
1 parent 2ce81ae commit 9f32b93

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pandas/core/arraylike.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ExtensionArray
66
"""
77
import operator
8-
from typing import Any, Callable
8+
from typing import Any
99
import warnings
1010

1111
import numpy as np
@@ -149,7 +149,7 @@ def __rpow__(self, other):
149149
return self._arith_method(other, roperator.rpow)
150150

151151

152-
def array_ufunc(self, ufunc: Callable, method: str, *inputs: Any, **kwargs: Any):
152+
def array_ufunc(self, ufunc: np.ufunc, method: str, *inputs: Any, **kwargs: Any):
153153
"""
154154
Compatibility with numpy ufuncs.
155155
@@ -257,9 +257,7 @@ def reconstruct(result):
257257
result = result.__finalize__(self)
258258
return result
259259

260-
if self.ndim > 1 and (
261-
len(inputs) > 1 or ufunc.nout > 1 # type: ignore[attr-defined]
262-
):
260+
if self.ndim > 1 and (len(inputs) > 1 or ufunc.nout > 1):
263261
# Just give up on preserving types in the complex case.
264262
# In theory we could preserve them for them.
265263
# * nout>1 is doable if BlockManager.apply took nout and
@@ -277,7 +275,7 @@ def reconstruct(result):
277275
mgr = inputs[0]._mgr
278276
result = mgr.apply(getattr(ufunc, method))
279277

280-
if ufunc.nout > 1: # type: ignore[attr-defined]
278+
if ufunc.nout > 1:
281279
result = tuple(reconstruct(x) for x in result)
282280
else:
283281
result = reconstruct(result)

0 commit comments

Comments
 (0)