File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 7
7
from typing import (
8
8
TYPE_CHECKING ,
9
9
Any ,
10
+ TypeVar ,
10
11
)
11
12
12
13
import numpy as np
26
27
if TYPE_CHECKING :
27
28
from pandas .core .arrays import ExtensionArray
28
29
30
+ # To parameterize on same ExtensionDtype
31
+ E = TypeVar ("E" , bound = "ExtensionDtype" )
32
+
29
33
30
34
class ExtensionDtype :
31
35
"""
@@ -151,7 +155,7 @@ def na_value(self) -> object:
151
155
return np .nan
152
156
153
157
@property
154
- def type (self ) -> type [Any ]:
158
+ def type (self ) -> type_t [Any ]:
155
159
"""
156
160
The scalar type for the array, e.g. ``int``
157
161
@@ -364,7 +368,7 @@ def _get_common_dtype(self, dtypes: list[DtypeObj]) -> DtypeObj | None:
364
368
return None
365
369
366
370
367
- def register_extension_dtype (cls : type [ExtensionDtype ]) -> type [ExtensionDtype ]:
371
+ def register_extension_dtype (cls : type [E ]) -> type [E ]:
368
372
"""
369
373
Register an ExtensionType with pandas as class decorator.
370
374
You can’t perform that action at this time.
0 commit comments