def pmt_to_vector(p): v = list() for i in range(pmt.length(p)): elem = pmt.vector_ref(p, i) v.append(pmt_to_python(elem)) return v