py_iterator function

Create a Python iterator from an R function