cache poly_dict so it is only built once