__slots__ = ["num", "snr", "hops_away", "ts", "long_name", "short_name"] class NodeDTO: def __init__(self, data): for slot in __slots__: setattr(self, slot, data.get(slot, None))