def _rearrange_args(l):
 if (len(l) == 1):
  return l
 x = list(l[(-1):])
 x.extend(l[0:(-1)])
 return Mul(*x).args

def _rearrange_args ( l ) : if ( len ( l ) == 1 ) : return l x = list ( l [ ( - 1 ) : ] ) x . extend ( l [ 0 : ( - 1 ) ] ) return Mul ( * x ) . args
this just moves the last arg to first position to enable expansion of args a .