Closed
Description
We allow for partially-initialized CategoricalDtypes to compare as equal to fully-initialized ones, leading to some surprising behaviors. The one that I stumbled over was this:
cat = pd.Categorical(["a", "b", "c"], ordered=True)
dtype = pd.CategoricalDtype()
>>> cat.dtype == dtype
True
cat2 = cat.astype(dtype)
>>> cat2.dtype == cat.dtype
False
We should stop special-casing categories=None for this purpose.