def __getattr__(self, name):
        #pylint: disable=invalid-name
        t = type(self)
        try:
            i = t.name_to_idx[name]
        except KeyError:
            raise AttributeError(name)
        f = t.fields[i]
        if i < len(self.data):
            v = self.data[i]
        else:
            v = ''
        if len(f) >= 3:
            if v == '':
                return None
            return f[2](v)
        else:
            return v
dataset/ETHPy150Open Knio/pynmea2/pynmea2/nmea.py/NMEASentence.__getattr__/original