The [:] was looping over a copy, so same net effect, but yours may be more efficient, depending on the size of the graph and the cost of appending to a list and the second loop.
I believe you made this change because NetworkX changed something about how copies can or can't be made. This is definitely fine to merge.
The
[:]
was looping over a copy, so same net effect, but yours may be more efficient, depending on the size of the graph and the cost of appending to a list and the second loop.I believe you made this change because NetworkX changed something about how copies can or can't be made. This is definitely fine to merge.