Skip to content

Wtd graph#8

Open
jefimenko wants to merge 14 commits intosimple_graphfrom
wtd_graph
Open

Wtd graph#8
jefimenko wants to merge 14 commits intosimple_graphfrom
wtd_graph

Conversation

@jefimenko
Copy link
Owner

No description provided.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is overly complex. Iterating over a range of the length of a list instead of simply iterating over the list is almost never what you really want. And I don't think it's what you want here. Why couldn't you try something less convoluted, like this:

for pair in self.g[n1]:
    if pair[0] == n2:
        self.g[n1].remove(pair)
        break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants