def terms(self, sort="auto", reverse=False):
    """
    Pairs (2-tuple) generator where each tuple has a (power, value) term,
    perhaps sorted by power. Useful for casting as dict.

    Parameters
    ----------
    sort :
      A boolean value or ``"auto"`` (default) which chooses whether the terms
      should be sorted. The ``"auto"`` value means ``True`` for Laurent
      polynomials (i.e., integer powers), ``False`` otherwise. If sorting is
      disabled, this method will yield the terms in the creation order.
    reverse :
      Boolean to chooses whether the [sorted or creation] order should be
      reversed when yielding the pairs. If False (default), yields in
      ascending or creation order (not counting possible updates in the
      coefficients).
    """
    if sort == "auto":
      sort = self.is_laurent()

    if sort:
      keys = sorted(self._data, reverse=reverse)
    elif reverse:
      keys = reversed(list(self._data))
    else:
      keys = self._data

    return ((k, self._data[k]) for k in keys)
Pairs (2-tuple) generator where each tuple has a (power, value) term,
    perhaps sorted by power. Useful for casting as dict.

    Parameters
    ----------
    sort :
      A boolean value or ``"auto"`` (default) which chooses whether the terms
      should be sorted. The ``"auto"`` value means ``True`` for Laurent
      polynomials (i.e., integer powers), ``False`` otherwise. If sorting is
      disabled, this method will yield the terms in the creation order.
    reverse :
      Boolean to chooses whether the [sorted or creation] order should be
      reversed when yielding the pairs. If False (default), yields in
      ascending or creation order (not counting possible updates in the
      coefficients).