def on_delete(self, node):    # ('targets',)
        """Delete statement."""
        for tnode in node.targets:
            if tnode.ctx.__class__ != ast.Del:
                break
            children = []
            while tnode.__class__ == ast.Attribute:
                children.append(tnode.attr)
                tnode = tnode.value

            if tnode.__class__ == ast.Name and tnode.id not in self.readonly_symbols:
                children.append(tnode.id)
                children.reverse()
                self.symtable.pop('.'.join(children))
            else:
                msg = "could not delete symbol"
                self.raise_exception(node, msg=msg)
def on_delete ( self , node ) : for tnode in node . targets : if tnode . ctx . __class__ != ast . Del : break children = [ ] while tnode . __class__ == ast . Attribute : children . append ( tnode . attr ) tnode = tnode . value if tnode . __class__ == ast . Name and tnode . id not in self . readonly_symbols : children . append ( tnode . id ) children . reverse ( ) self . symtable . pop ( '.' . join ( children ) ) else : msg = "could not delete symbol" self . raise_exception ( node , msg = msg )
Delete statement.