class_docstr: Quadrature rules are implemented using this class, in order to
  simplify the code and provide a common infrastructure
  for tasks such as error estimation and node caching.
  
  You can implement a custom quadrature rule by subclassing
  :class:`QuadratureRule` and implementing the appropriate
  methods. The subclass can then be used by :func:`~mpmath.quad` by
  passing it as the *method* argument.
  
  :class:`QuadratureRule` instances are supposed to be singletons.
  :class:`QuadratureRule` therefore implements instance caching
  in :func:`~mpmath.__new__`.
class_docstr_tok: ["Quadrature","rules","are","implemented","using","this","class",",","in","order","to","simplify","the","code","and","provide","a","common","infrastructure","for","tasks","such","as","error","estimation","and","node","caching",".","You","can","implement","a","custom","quadrature","rule","by","subclassing",":","class",":","`","QuadratureRule","`","and","implementing","the","appropriate","methods",".","The","subclass","can","then","be","used","by",":","func",":","`","~mpmath.quad","`","by","passing","it","as","the","*","method","*","argument",".",":","class",":","`","QuadratureRule","`","instances","are","supposed","to","be","singletons",".",":","class",":","`","QuadratureRule","`","therefore","implements","instance","caching","in",":","func",":","`","~mpmath.__new__","`","."]
docstr: Evaluates the step sum `\sum w_k f(x_k)` where the *nodes* list
  contains the `(w_k, x_k)` pairs.
  
  :func:`~mpmath.summation` will supply the list *results* of
  values computed by :func:`~mpmath.sum_next` at previous degrees, in
  case the quadrature rule is able to reuse them.
docstr_tok: ["Evaluates","the","step","sum","`","\\sum","w_k","f","(","x_k",")","`","where","the","*","nodes","*","list","contains","the","`","(","w_k",",","x_k",")","`","pairs",".",":","func",":","`","~mpmath.summation","`","will","supply","the","list","*","results","*","of","values","computed","by",":","func",":","`","~mpmath.sum_next","`","at","previous","degrees",",","in","case","the","quadrature","rule","is","able","to","reuse","them","."]
code: def sum_next(self, f, nodes, degree, prec, previous, verbose=False):
      r"""
      Evaluates the step sum `\sum w_k f(x_k)` where the *nodes* list
      contains the `(w_k, x_k)` pairs.
  
      :func:`~mpmath.summation` will supply the list *results* of
      values computed by :func:`~mpmath.sum_next` at previous degrees, in
      case the quadrature rule is able to reuse them.
      """
      return self.ctx.fdot((w, f(x)) for (x, w) in nodes)
  
imports: import math
  from ..libmp.backend import xrange
label_desc: Use image node_id 9 for calling the QuadratureRule obj's underlying member method code with example usage: obj.sum_next(f, nodes, degree, prec, previous, verbose) and returns: self