def is_dtype_equal(self, other):
        """
        Returns True if categoricals are the same dtype
          same categories, and same ordered

        Parameters
        ----------
        other : Categorical

        Returns
        -------
        are_equal : boolean
        """

        try:
            return (self.categories.equals(other.categories) and
                    self.ordered == other.ordered)
        except (AttributeError, __HOLE__):
            return False
dataset/ETHPy150Open pydata/pandas/pandas/core/categorical.py/Categorical.is_dtype_equal