PyCQA / redbaron

Bottom-up approach to refactoring in python
http://redbaron.pycqa.org/
694 stars 74 forks source link

Feature request: Add a node.remove() method #181

Open kenseehart opened 5 years ago

kenseehart commented 5 years ago

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.