

def _asdict(self):
    'Convert this measurement to a dict of basic types.'
    retval = {
        'name': self.name,
        'outcome': self.outcome,
    }
    if len(self.validators):
        retval['validators'] = [str(v) for v in self.validators]
    for attr in ('units', 'dimensions', 'docstring'):
        if (getattr(retval, attr) is not None):
            retval[attr] = getattr(self, attr)
    return retval

dataset/ETHPy150Open google/openhtf/openhtf/util/measurements.py Measurement._asdict/VarMisuse@78/115 `self`->`retval`