`compare_attrs` would be a better name than `tmp` here.