add support for subprogram evaluation to Python API