@@ -214,13 +214,13 @@ class CategoricalDtype(PandasExtensionDtype, ExtensionDtype):
214
214
_metadata = ('categories' , 'ordered' )
215
215
_cache = {} # type: Dict[str_type, PandasExtensionDtype]
216
216
217
- def __init__ (self , categories = None , ordered : bool = None ):
217
+ def __init__ (self , categories = None , ordered : Optional [ bool ] = None ):
218
218
self ._finalize (categories , ordered , fastpath = False )
219
219
220
220
@classmethod
221
221
def _from_fastpath (cls ,
222
222
categories = None ,
223
- ordered : bool = None
223
+ ordered : Optional [ bool ] = None
224
224
) -> 'CategoricalDtype' :
225
225
self = cls .__new__ (cls )
226
226
self ._finalize (categories , ordered , fastpath = True )
@@ -230,7 +230,7 @@ def _from_fastpath(cls,
230
230
def _from_categorical_dtype (cls ,
231
231
dtype : 'CategoricalDtype' ,
232
232
categories = None ,
233
- ordered : bool = None ,
233
+ ordered : Optional [ bool ] = None ,
234
234
) -> 'CategoricalDtype' :
235
235
if categories is ordered is None :
236
236
return dtype
@@ -244,8 +244,8 @@ def _from_categorical_dtype(cls,
244
244
def _from_values_or_dtype (cls ,
245
245
values = None ,
246
246
categories = None ,
247
- ordered : bool = None ,
248
- dtype : 'CategoricalDtype' = None ,
247
+ ordered : Optional [ bool ] = None ,
248
+ dtype : Optional [ 'CategoricalDtype' ] = None ,
249
249
) -> 'CategoricalDtype' :
250
250
"""
251
251
Construct dtype from the input parameters used in :class:`Categorical`.
0 commit comments