{"action":"created","comment":{"url":"https://api.github.com/repos/networkx/networkx/pulls/comments/36159787","id":36159787,"diff_hunk":"@@ -79,172 +82,184 @@ def is_directed_acyclic_graph(G):\n     if not G.is_directed():\n         return False\n     try:\n-        topological_sort(G, reverse=True)\n+        consume(topological_sort(G))\n         return True\n     except nx.NetworkXUnfeasible:\n         return False\n \n \n-def topological_sort(G, nbunch=None, reverse=False):\n-    \"\"\"Return a list of nodes in topological sort order.\n+def topological_sort(G):","path":"networkx/algorithms/dag.py","position":50,"original_position":50,"commit_id":"c490f5a080e694320fdd69c495a825aa15dba97c","original_commit_id":"c490f5a080e694320fdd69c495a825aa15dba97c","user":{"login":"MisterSheik","id":730137,"avatar_url":"https://avatars.githubusercontent.com/u/730137?v=3","gravatar_id":"","url":"https://api.github.com/users/MisterSheik","html_url":"https://github.com/MisterSheik","followers_url":"https://api.github.com/users/MisterSheik/followers","following_url":"https://api.github.com/users/MisterSheik/following{/other_user}","gists_url":"https://api.github.com/users/MisterSheik/gists{/gist_id}","starred_url":"https://api.github.com/users/MisterSheik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MisterSheik/subscriptions","organizations_url":"https://api.github.com/users/MisterSheik/orgs","repos_url":"https://api.github.com/users/MisterSheik/repos","events_url":"https://api.github.com/users/MisterSheik/events{/privacy}","received_events_url":"https://api.github.com/users/MisterSheik/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2015-08-04T06:07:49Z","updated_at":"2015-08-04T06:07:49Z","html_url":"https://github.com/networkx/networkx/pull/1662#discussion_r36159787","pull_request_url":"https://api.github.com/repos/networkx/networkx/pulls/1662","_links":{"self":{"href":"https://api.github.com/repos/networkx/networkx/pulls/comments/36159787"},"html":{"href":"https://github.com/networkx/networkx/pull/1662#discussion_r36159787"},"pull_request":{"href":"https://api.github.com/repos/networkx/networkx/pulls/1662"}}},"pull_request":{"url":"https://api.github.com/repos/networkx/networkx/pulls/1662","id":39846719,"html_url":"https://github.com/networkx/networkx/pull/1662","diff_url":"https://github.com/networkx/networkx/pull/1662.diff","patch_url":"https://github.com/networkx/networkx/pull/1662.patch","issue_url":"https://api.github.com/repos/networkx/networkx/issues/1662","number":1662,"state":"open","locked":false,"title":"topolgical_sort, lexicographical_topological_sort","user":{"login":"MisterSheik","id":730137,"avatar_url":"https://avatars.githubusercontent.com/u/730137?v=3","gravatar_id":"","url":"https://api.github.com/users/MisterSheik","html_url":"https://github.com/MisterSheik","followers_url":"https://api.github.com/users/MisterSheik/followers","following_url":"https://api.github.com/users/MisterSheik/following{/other_user}","gists_url":"https://api.github.com/users/MisterSheik/gists{/gist_id}","starred_url":"https://api.github.com/users/MisterSheik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MisterSheik/subscriptions","organizations_url":"https://api.github.com/users/MisterSheik/orgs","repos_url":"https://api.github.com/users/MisterSheik/repos","events_url":"https://api.github.com/users/MisterSheik/events{/privacy}","received_events_url":"https://api.github.com/users/MisterSheik/received_events","type":"User","site_admin":false},"body":"Rewrote topolgical_sort as a generator:\r\n* It no longer accepts reverse or nbunch arguments\r\n* It is slightly faster.\r\nAdded lexicographical_topological_sort, which accepts a key.\r\nSome tests for topological sort were removed because they relied on\r\nCPython's particular dict element ordering.\r\nAdded utils from more_itertools:\r\n* These were necessary for working with the new generators.\r\n* \"pairwise\" is equavalent to zip(some_list, some_list[1:]) -- for\r\ngenerators.\r\n* \"consume\" consumes an iterator.","created_at":"2015-07-13T19:25:29Z","updated_at":"2015-08-04T06:07:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79dd85c43417d7996c94edcb387f891cc33872ff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/networkx/networkx/pulls/1662/commits","review_comments_url":"https://api.github.com/repos/networkx/networkx/pulls/1662/comments","review_comment_url":"https://api.github.com/repos/networkx/networkx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/networkx/networkx/issues/1662/comments","statuses_url":"https://api.github.com/repos/networkx/networkx/statuses/c490f5a080e694320fdd69c495a825aa15dba97c","head":{"label":"MisterSheik:topo","ref":"topo","sha":"c490f5a080e694320fdd69c495a825aa15dba97c","user":{"login":"MisterSheik","id":730137,"avatar_url":"https://avatars.githubusercontent.com/u/730137?v=3","gravatar_id":"","url":"https://api.github.com/users/MisterSheik","html_url":"https://github.com/MisterSheik","followers_url":"https://api.github.com/users/MisterSheik/followers","following_url":"https://api.github.com/users/MisterSheik/following{/other_user}","gists_url":"https://api.github.com/users/MisterSheik/gists{/gist_id}","starred_url":"https://api.github.com/users/MisterSheik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MisterSheik/subscriptions","organizations_url":"https://api.github.com/users/MisterSheik/orgs","repos_url":"https://api.github.com/users/MisterSheik/repos","events_url":"https://api.github.com/users/MisterSheik/events{/privacy}","received_events_url":"https://api.github.com/users/MisterSheik/received_events","type":"User","site_admin":false},"repo":{"id":39032000,"name":"networkx","full_name":"MisterSheik/networkx","owner":{"login":"MisterSheik","id":730137,"avatar_url":"https://avatars.githubusercontent.com/u/730137?v=3","gravatar_id":"","url":"https://api.github.com/users/MisterSheik","html_url":"https://github.com/MisterSheik","followers_url":"https://api.github.com/users/MisterSheik/followers","following_url":"https://api.github.com/users/MisterSheik/following{/other_user}","gists_url":"https://api.github.com/users/MisterSheik/gists{/gist_id}","starred_url":"https://api.github.com/users/MisterSheik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MisterSheik/subscriptions","organizations_url":"https://api.github.com/users/MisterSheik/orgs","repos_url":"https://api.github.com/users/MisterSheik/repos","events_url":"https://api.github.com/users/MisterSheik/events{/privacy}","received_events_url":"https://api.github.com/users/MisterSheik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MisterSheik/networkx","description":"Official NetworkX source code repository.  ","fork":true,"url":"https://api.github.com/repos/MisterSheik/networkx","forks_url":"https://api.github.com/repos/MisterSheik/networkx/forks","keys_url":"https://api.github.com/repos/MisterSheik/networkx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MisterSheik/networkx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MisterSheik/networkx/teams","hooks_url":"https://api.github.com/repos/MisterSheik/networkx/hooks","issue_events_url":"https://api.github.com/repos/MisterSheik/networkx/issues/events{/number}","events_url":"https://api.github.com/repos/MisterSheik/networkx/events","assignees_url":"https://api.github.com/repos/MisterSheik/networkx/assignees{/user}","branches_url":"https://api.github.com/repos/MisterSheik/networkx/branches{/branch}","tags_url":"https://api.github.com/repos/MisterSheik/networkx/tags","blobs_url":"https://api.github.com/repos/MisterSheik/networkx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MisterSheik/networkx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MisterSheik/networkx/git/refs{/sha}","trees_url":"https://api.github.com/repos/MisterSheik/networkx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MisterSheik/networkx/statuses/{sha}","languages_url":"https://api.github.com/repos/MisterSheik/networkx/languages","stargazers_url":"https://api.github.com/repos/MisterSheik/networkx/stargazers","contributors_url":"https://api.github.com/repos/MisterSheik/networkx/contributors","subscribers_url":"https://api.github.com/repos/MisterSheik/networkx/subscribers","subscription_url":"https://api.github.com/repos/MisterSheik/networkx/subscription","commits_url":"https://api.github.com/repos/MisterSheik/networkx/commits{/sha}","git_commits_url":"https://api.github.com/repos/MisterSheik/networkx/git/commits{/sha}","comments_url":"https://api.github.com/repos/MisterSheik/networkx/comments{/number}","issue_comment_url":"https://api.github.com/repos/MisterSheik/networkx/issues/comments{/number}","contents_url":"https://api.github.com/repos/MisterSheik/networkx/contents/{+path}","compare_url":"https://api.github.com/repos/MisterSheik/networkx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MisterSheik/networkx/merges","archive_url":"https://api.github.com/repos/MisterSheik/networkx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MisterSheik/networkx/downloads","issues_url":"https://api.github.com/repos/MisterSheik/networkx/issues{/number}","pulls_url":"https://api.github.com/repos/MisterSheik/networkx/pulls{/number}","milestones_url":"https://api.github.com/repos/MisterSheik/networkx/milestones{/number}","notifications_url":"https://api.github.com/repos/MisterSheik/networkx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MisterSheik/networkx/labels{/name}","releases_url":"https://api.github.com/repos/MisterSheik/networkx/releases{/id}","created_at":"2015-07-13T19:12:02Z","updated_at":"2015-07-13T19:12:04Z","pushed_at":"2015-07-13T19:24:16Z","git_url":"git://github.com/MisterSheik/networkx.git","ssh_url":"git@github.com:MisterSheik/networkx.git","clone_url":"https://github.com/MisterSheik/networkx.git","svn_url":"https://github.com/MisterSheik/networkx","homepage":"http://networkx.github.io","size":13307,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"networkx:master","ref":"master","sha":"b5c0cbed0718c59bb26eb05f12a5772f253cac2a","user":{"login":"networkx","id":388785,"avatar_url":"https://avatars.githubusercontent.com/u/388785?v=3","gravatar_id":"","url":"https://api.github.com/users/networkx","html_url":"https://github.com/networkx","followers_url":"https://api.github.com/users/networkx/followers","following_url":"https://api.github.com/users/networkx/following{/other_user}","gists_url":"https://api.github.com/users/networkx/gists{/gist_id}","starred_url":"https://api.github.com/users/networkx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/networkx/subscriptions","organizations_url":"https://api.github.com/users/networkx/orgs","repos_url":"https://api.github.com/users/networkx/repos","events_url":"https://api.github.com/users/networkx/events{/privacy}","received_events_url":"https://api.github.com/users/networkx/received_events","type":"Organization","site_admin":false},"repo":{"id":890377,"name":"networkx","full_name":"networkx/networkx","owner":{"login":"networkx","id":388785,"avatar_url":"https://avatars.githubusercontent.com/u/388785?v=3","gravatar_id":"","url":"https://api.github.com/users/networkx","html_url":"https://github.com/networkx","followers_url":"https://api.github.com/users/networkx/followers","following_url":"https://api.github.com/users/networkx/following{/other_user}","gists_url":"https://api.github.com/users/networkx/gists{/gist_id}","starred_url":"https://api.github.com/users/networkx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/networkx/subscriptions","organizations_url":"https://api.github.com/users/networkx/orgs","repos_url":"https://api.github.com/users/networkx/repos","events_url":"https://api.github.com/users/networkx/events{/privacy}","received_events_url":"https://api.github.com/users/networkx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/networkx/networkx","description":"Official NetworkX source code repository.  ","fork":false,"url":"https://api.github.com/repos/networkx/networkx","forks_url":"https://api.github.com/repos/networkx/networkx/forks","keys_url":"https://api.github.com/repos/networkx/networkx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/networkx/networkx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/networkx/networkx/teams","hooks_url":"https://api.github.com/repos/networkx/networkx/hooks","issue_events_url":"https://api.github.com/repos/networkx/networkx/issues/events{/number}","events_url":"https://api.github.com/repos/networkx/networkx/events","assignees_url":"https://api.github.com/repos/networkx/networkx/assignees{/user}","branches_url":"https://api.github.com/repos/networkx/networkx/branches{/branch}","tags_url":"https://api.github.com/repos/networkx/networkx/tags","blobs_url":"https://api.github.com/repos/networkx/networkx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/networkx/networkx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/networkx/networkx/git/refs{/sha}","trees_url":"https://api.github.com/repos/networkx/networkx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/networkx/networkx/statuses/{sha}","languages_url":"https://api.github.com/repos/networkx/networkx/languages","stargazers_url":"https://api.github.com/repos/networkx/networkx/stargazers","contributors_url":"https://api.github.com/repos/networkx/networkx/contributors","subscribers_url":"https://api.github.com/repos/networkx/networkx/subscribers","subscription_url":"https://api.github.com/repos/networkx/networkx/subscription","commits_url":"https://api.github.com/repos/networkx/networkx/commits{/sha}","git_commits_url":"https://api.github.com/repos/networkx/networkx/git/commits{/sha}","comments_url":"https://api.github.com/repos/networkx/networkx/comments{/number}","issue_comment_url":"https://api.github.com/repos/networkx/networkx/issues/comments{/number}","contents_url":"https://api.github.com/repos/networkx/networkx/contents/{+path}","compare_url":"https://api.github.com/repos/networkx/networkx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/networkx/networkx/merges","archive_url":"https://api.github.com/repos/networkx/networkx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/networkx/networkx/downloads","issues_url":"https://api.github.com/repos/networkx/networkx/issues{/number}","pulls_url":"https://api.github.com/repos/networkx/networkx/pulls{/number}","milestones_url":"https://api.github.com/repos/networkx/networkx/milestones{/number}","notifications_url":"https://api.github.com/repos/networkx/networkx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/networkx/networkx/labels{/name}","releases_url":"https://api.github.com/repos/networkx/networkx/releases{/id}","created_at":"2010-09-06T00:53:44Z","updated_at":"2015-08-03T18:23:58Z","pushed_at":"2015-08-04T04:55:34Z","git_url":"git://github.com/networkx/networkx.git","ssh_url":"git@github.com:networkx/networkx.git","clone_url":"https://github.com/networkx/networkx.git","svn_url":"https://github.com/networkx/networkx","homepage":"http://networkx.github.io","size":23766,"stargazers_count":1521,"watchers_count":1521,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":494,"mirror_url":null,"open_issues_count":261,"forks":494,"open_issues":261,"watchers":1521,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/networkx/networkx/pulls/1662"},"html":{"href":"https://github.com/networkx/networkx/pull/1662"},"issue":{"href":"https://api.github.com/repos/networkx/networkx/issues/1662"},"comments":{"href":"https://api.github.com/repos/networkx/networkx/issues/1662/comments"},"review_comments":{"href":"https://api.github.com/repos/networkx/networkx/pulls/1662/comments"},"review_comment":{"href":"https://api.github.com/repos/networkx/networkx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/networkx/networkx/pulls/1662/commits"},"statuses":{"href":"https://api.github.com/repos/networkx/networkx/statuses/c490f5a080e694320fdd69c495a825aa15dba97c"}}}}