@@ -108,12 +108,10 @@ class PandasExtensionDtype(_DtypeOpsMixin):
108
108
"""
109
109
type = None # type: Any
110
110
kind = None # type: Any
111
- """
112
- The Any type annotations above are here only because mypy seems to have a
113
- problem dealing with with multiple inheritance from PandasExtensionDtype
114
- and ExtensionDtype's @properties in the subclasses below. Those subclasses
115
- are explicitly typed, as appropriate.
116
- """
111
+ # The Any type annotations above are here only because mypy seems to have a
112
+ # problem dealing with with multiple inheritance from PandasExtensionDtype
113
+ # and ExtensionDtype's @properties in the subclasses below. The kind and
114
+ # type variables in those subclasses are explicitly typed below.
117
115
subdtype = None
118
116
str = None # type: Optional[builtins.str]
119
117
num = 100
@@ -122,7 +120,7 @@ class PandasExtensionDtype(_DtypeOpsMixin):
122
120
base = None
123
121
isbuiltin = 0
124
122
isnative = 0
125
- _cache = {} # type: Dict[builtins.str, object ]
123
+ _cache = {} # type: Dict[builtins.str, 'PandasExtensionDtype' ]
126
124
127
125
def __unicode__ (self ):
128
126
return self .name
@@ -230,7 +228,7 @@ class CategoricalDtype(PandasExtensionDtype, ExtensionDtype):
230
228
str = '|O08'
231
229
base = np .dtype ('O' )
232
230
_metadata = ('categories' , 'ordered' )
233
- _cache = {} # type: Dict[builtins.str, object ]
231
+ _cache = {} # type: Dict[builtins.str, PandasExtensionDtype ]
234
232
235
233
def __init__ (self , categories = None , ordered = None ):
236
234
self ._finalize (categories , ordered , fastpath = False )
@@ -600,7 +598,7 @@ class DatetimeTZDtype(PandasExtensionDtype, ExtensionDtype):
600
598
na_value = NaT
601
599
_metadata = ('unit' , 'tz' )
602
600
_match = re .compile (r"(datetime64|M8)\[(?P<unit>.+), (?P<tz>.+)\]" )
603
- _cache = {} # type: Dict[builtins.str, object ]
601
+ _cache = {} # type: Dict[builtins.str, PandasExtensionDtype ]
604
602
605
603
def __init__ (self , unit = "ns" , tz = None ):
606
604
"""
@@ -751,7 +749,7 @@ class PeriodDtype(ExtensionDtype, PandasExtensionDtype):
751
749
num = 102
752
750
_metadata = ('freq' ,)
753
751
_match = re .compile (r"(P|p)eriod\[(?P<freq>.+)\]" )
754
- _cache = {} # type: Dict[builtins.str, object ]
752
+ _cache = {} # type: Dict[builtins.str, PandasExtensionDtype ]
755
753
756
754
def __new__ (cls , freq = None ):
757
755
"""
@@ -874,7 +872,7 @@ class IntervalDtype(PandasExtensionDtype, ExtensionDtype):
874
872
num = 103
875
873
_metadata = ('subtype' ,)
876
874
_match = re .compile (r"(I|i)nterval\[(?P<subtype>.+)\]" )
877
- _cache = {} # type: Dict[builtins.str, object ]
875
+ _cache = {} # type: Dict[builtins.str, PandasExtensionDtype ]
878
876
879
877
def __new__ (cls , subtype = None ):
880
878
"""
0 commit comments