def __setitem__(self, key, value):
<EOL>if key in self:<EOL><INDENT>del self[key]<EOL><DEDENT>if not isinstance(value, self.default_factory):<EOL><INDENT>value = self.default_factory(self, key)<EOL><DEDENT>super(EntriesCollection, self).__setitem__(key, value)<EOL>if self.synchronized:<EOL><INDENT>self.add_date(key)<EOL>for entry in value:<EOL><INDENT>self.add_entry(entry)<EOL><DEDENT><DEDENT>
If in synchronized mode, add the date and the entries to the
textual representation.