def _rec_list_terms(g, v, monom):
 (d, terms) = (dmp_degree(g, v), [])
 if (not v):
  for (i, c) in enumerate(g):
   if (not c):
    continue
   terms.append(((monom + ((d - i),)), c))
 else:
  w = (v - 1)
  for (i, c) in enumerate(g):
   terms.extend(_rec_list_terms(c, w, (monom + ((d - i),))))
 return terms

def _rec_list_terms ( g , v , monom ) : ( d , terms ) = ( dmp_degree ( g , v ) , [ ] ) if ( not v ) : for ( i , c ) in enumerate ( g ) : if ( not c ) : continue terms . append ( ( ( monom + ( ( d - i ) , ) ) , c ) ) else : w = ( v - 1 ) for ( i , c ) in enumerate ( g ) : terms . extend ( _rec_list_terms ( c , w , ( monom + ( ( d - i ) , ) ) ) ) return terms
recursive helper for :func:dmp_list_terms .