<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def to_dict(self):
        '''Save this message sending object into a dictionary.'''
        targets = []
        for cond in self._targets:
            targets.append(cond.to_dict())
        if targets:
            return {'targets': targets}
        else:
            return {}