def __delitem__(self, obj, sync=True):
if self._is_item:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>list(self._generate_instances())<EOL>_lnk_key = None<EOL>if isinstance(obj, six.string_types):<EOL><INDENT>_lnk_key = obj<EOL>_obj = self.node_dict[obj]<EOL><DEDENT>elif not isinstance(obj, self.__class__):<EOL><INDENT>_lnk_key = obj.key<EOL>_obj = self.node_dict[obj.key]<EOL>del self.node_dict[obj.key]<EOL><DEDENT>else:<EOL><INDENT>_obj = obj<EOL><DEDENT>self.node_stack.remove(_obj)<EOL>if _lnk_key and sync:<EOL><INDENT>rel_name = "<STR_LIT>" % (_obj.__class__.__name__,<EOL>_obj.get_link()['<STR_LIT>'])<EOL>remote_node_name = self._root_node.get_link(field=rel_name)['<STR_LIT>']<EOL>_lnk_obj = getattr(_obj, _obj.get_link()['<STR_LIT>'])<EOL>getattr(_lnk_obj, remote_node_name).__delitem__(self._root_node.key, sync=False)<EOL>self._root_node.on_save.append(_lnk_obj.save)<EOL><DEDENT>
Allow usage of "del" statement on ListNodes with bracket notation.

Args:
    obj: ListNode item or relation key.

Raises:
    TypeError: If it's called on a ListNode item (intstead of ListNode's itself)