replaceChild 是否会在 Python minidom DOM 实现中中断 childNodes 迭代?

Does replaceChild break childNodes iteration in Python minidom DOM implementation?

replaceChild() 会在 Python 迷你王国中打破 for 循环 childNodes 吗?

考虑以下代码,其中 v 是一个 minidom 节点:

    for w in v.childNodes:
        if ...:
            frag = parseString(...)
            v.replaceChild(w, frag.documentElement)

依次枚举所有子节点是否会如预期的那样工作?或者 replaceChild 会打破 for 循环吗?

https://www.w3.org/TR/DOM-Level-1/level-one-core.html 说:

The content of the returned NodeList is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList accessors; it is not a static snapshot of the content of the node.

由此可见,循环不会被打破。