support iteration in python interface