Thank you! - that does explain the error.
If I convert back within the function (as below) , it eliminates the error message, and also seems to work in my "real" problem. Are there better ways to do this "conversion back" (to something compatible with symbolic expressions) than using RealField?
from mpmath import *
def f(a,b):
a=RealField(100)(a)