def __repr__(self):
        val = self._getval()
        if isNamedClass(val, Parameter):
            val = val._getval()
        w = []
        if self.name is not None:
            w.append("name='%s'" % self.name)

        if self.decimals is not None and val is not None:
            fmtstr = "value=%." + str(self.decimals) + "f"
            string = fmtstr % float(repr(val))
            if self.stderr is not None:
                fmtstr = " +/- %." + str(self.decimals) + "f"
                string = string + fmtstr % self.stderr
            if self.units is not None:
                string = string + " %s" % self.units
            w.append(string)
        else:
            w.append("value=%s" % repr(val))

        w.append('vary=%s' % repr(self.vary))
        if self._expr is not None:
            w.append("expr='%s'" % self._expr)
        if self.min not in (None, -inf):
            w.append('min=%s' % repr(self.min))
        if self.max not in (None, inf):
            w.append('max=%s' % repr(self.max))
        return 'param(%s)' % ', '.join(w)

    #def __new__(self, value=0, **kws): return float.__new__(self, val)

    # these are more or less straight emulation of float,
    # but using _getval() to get current value
dataset/ETHPy150Open xraypy/xraylarch/lib/fitting/parameter.py/Parameter.__repr__/original