@@ -214,13 +214,13 @@ class CategoricalDtype(PandasExtensionDtype, ExtensionDtype):
214214 _metadata = ('categories' , 'ordered' )
215215 _cache = {} # type: Dict[str_type, PandasExtensionDtype]
216216
217- def __init__ (self , categories = None , ordered : bool = None ):
217+ def __init__ (self , categories = None , ordered : Optional [ bool ] = None ):
218218 self ._finalize (categories , ordered , fastpath = False )
219219
220220 @classmethod
221221 def _from_fastpath (cls ,
222222 categories = None ,
223- ordered : bool = None
223+ ordered : Optional [ bool ] = None
224224 ) -> 'CategoricalDtype' :
225225 self = cls .__new__ (cls )
226226 self ._finalize (categories , ordered , fastpath = True )
@@ -230,7 +230,7 @@ def _from_fastpath(cls,
230230 def _from_categorical_dtype (cls ,
231231 dtype : 'CategoricalDtype' ,
232232 categories = None ,
233- ordered : bool = None ,
233+ ordered : Optional [ bool ] = None ,
234234 ) -> 'CategoricalDtype' :
235235 if categories is ordered is None :
236236 return dtype
@@ -244,8 +244,8 @@ def _from_categorical_dtype(cls,
244244 def _from_values_or_dtype (cls ,
245245 values = None ,
246246 categories = None ,
247- ordered : bool = None ,
248- dtype : 'CategoricalDtype' = None ,
247+ ordered : Optional [ bool ] = None ,
248+ dtype : Optional [ 'CategoricalDtype' ] = None ,
249249 ) -> 'CategoricalDtype' :
250250 """
251251 Construct dtype from the input parameters used in :class:`Categorical`.
0 commit comments