

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(self)
    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))

dataset/ETHPy150Open xraypy/xraylarch/lib/fitting/parameter.py Parameter.__repr__/VarMisuse@195/236 `string`->`self`