Generate constraints for pytd templated functions.