

def replaceChild(self, newChild, oldChild):
    '\n        Replace a L{Node} which is already a child of this node with a\n        different node.\n\n        @param newChild: A L{Node} which will be made a child of this node.\n\n        @param oldChild: A L{Node} which is a child of this node which will\n            give up its position to C{newChild}.\n\n        @raise TypeError: If C{newChild} or C{oldChild} is not a C{Node}\n            instance.\n\n        @raise ValueError: If C{oldChild} is not a child of this C{Node}.\n        '
    if ((not isinstance(newChild, Node)) or (not isinstance(oldChild, Node))):
        raise TypeError('expected Node instance')
    if (oldChild.parentNode is not self):
        raise ValueError('oldChild is not a child of this node')
    self.childNodes[self.childNodes.index(oldChild)] = newChild
    newChild.parentNode = None
    newChild.parentNode = self

dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/web/microdom.py Node.replaceChild/VarMisuse@83/329 `oldChild`->`newChild`