Add __hash__ method on tags