PERF: Cache hashing of categories by fjetter · Pull Request #40193 · pandas-dev/pandas (original) (raw)

def test_mixed(self):
    a = CategoricalDtype(["a", "b", 1, 2])
    b = CategoricalDtype(["a", "b", "1", "2"])
  assert hash(a) != hash(b)

E AssertionError: assert 7627359294613847363 != 7627359294613847363 E + where 7627359294613847363 = hash(CategoricalDtype(categories=['a', 'b', 1, 2], ordered=False)) E + and 7627359294613847363 = hash(CategoricalDtype(categories=['a', 'b', '1', '2'], ordered=False))