@@ -1874,7 +1874,7 @@ def __iter__(self):
18741874 """
18751875 return iter (self ._internal_get_values ().tolist ())
18761876
1877- def __contains__ (self , key ):
1877+ def __contains__ (self , key ) -> bool :
18781878 """
18791879 Returns True if `key` is in this Categorical.
18801880 """
@@ -1884,7 +1884,7 @@ def __contains__(self, key):
18841884
18851885 return contains (self , key , container = self ._codes )
18861886
1887- def _tidy_repr (self , max_vals = 10 , footer = True ):
1887+ def _tidy_repr (self , max_vals = 10 , footer = True ) -> str :
18881888 """ a short repr displaying only max_vals and an optional (but default
18891889 footer)
18901890 """
@@ -1921,7 +1921,7 @@ def _repr_categories(self):
19211921 category_strs = [x .strip () for x in category_strs ]
19221922 return category_strs
19231923
1924- def _repr_categories_info (self ):
1924+ def _repr_categories_info (self ) -> str :
19251925 """
19261926 Returns a string representation of the footer.
19271927 """
@@ -1951,11 +1951,11 @@ def _repr_categories_info(self):
19511951 # replace to simple save space by
19521952 return levheader + "[" + levstring .replace (" < ... < " , " ... " ) + "]"
19531953
1954- def _repr_footer (self ):
1954+ def _repr_footer (self ) -> str :
19551955 info = self ._repr_categories_info ()
19561956 return f"Length: { len (self )} \n { info } "
19571957
1958- def _get_repr (self , length = True , na_rep = "NaN" , footer = True ):
1958+ def _get_repr (self , length = True , na_rep = "NaN" , footer = True ) -> str :
19591959 from pandas .io .formats import format as fmt
19601960
19611961 formatter = fmt .CategoricalFormatter (
0 commit comments