Skip to content

Commit ac2e3e6

Browse files
committed
Revert minor changes causing mypy issues
1 parent 1be9f58 commit ac2e3e6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pandas/core/dtypes/base.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def construct_array_type(cls) -> type_t[ExtensionArray]:
213213
raise NotImplementedError
214214

215215
@classmethod
216-
def construct_from_string(cls, string: str) -> ExtensionDtype:
216+
def construct_from_string(cls, string: str):
217217
r"""
218218
Construct this type from a string.
219219
@@ -424,7 +424,7 @@ def register(self, dtype: type[ExtensionDtype]) -> None:
424424

425425
self.dtypes.append(dtype)
426426

427-
def find(self, dtype: type[E] | E | str) -> type[E] | E | ExtensionDtype | None:
427+
def find(self, dtype: type[ExtensionDtype] | str) -> type[ExtensionDtype] | None:
428428
"""
429429
Parameters
430430
----------
@@ -435,9 +435,8 @@ def find(self, dtype: type[E] | E | str) -> type[E] | E | ExtensionDtype | None:
435435
return the first matching dtype, otherwise return None
436436
"""
437437
if not isinstance(dtype, str):
438-
if isinstance(dtype, type):
439-
dtype_type = dtype
440-
else:
438+
dtype_type = dtype
439+
if not isinstance(dtype, type):
441440
dtype_type = type(dtype)
442441
if issubclass(dtype_type, ExtensionDtype):
443442
return dtype

0 commit comments

Comments
 (0)