Make Dimension object hashable