The pattern del x.parent[x.index_on_parent] doesn't work in all cases.
Deleting a node is a common operation, so it would be really neat if node.remove() would do it.
This could leave the parent block empty. Perhaps this would insert a 'pass' on removing the last node.
The pattern del x.parent[x.index_on_parent] doesn't work in all cases. Deleting a node is a common operation, so it would be really neat if node.remove() would do it. This could leave the parent block empty. Perhaps this would insert a 'pass' on removing the last node.