{"action":"created","issue":{"url":"https://api.github.com/repos/networkx/networkx/issues/1534","labels_url":"https://api.github.com/repos/networkx/networkx/issues/1534/labels{/name}","comments_url":"https://api.github.com/repos/networkx/networkx/issues/1534/comments","events_url":"https://api.github.com/repos/networkx/networkx/issues/1534/events","html_url":"https://github.com/networkx/networkx/pull/1534","id":78328925,"number":1534,"title":"Use peek(S) instead of next(iter(S)).","user":{"login":"jfinkels","id":121755,"avatar_url":"https://avatars.githubusercontent.com/u/121755?v=3","gravatar_id":"","url":"https://api.github.com/users/jfinkels","html_url":"https://github.com/jfinkels","followers_url":"https://api.github.com/users/jfinkels/followers","following_url":"https://api.github.com/users/jfinkels/following{/other_user}","gists_url":"https://api.github.com/users/jfinkels/gists{/gist_id}","starred_url":"https://api.github.com/users/jfinkels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfinkels/subscriptions","organizations_url":"https://api.github.com/users/jfinkels/orgs","repos_url":"https://api.github.com/users/jfinkels/repos","events_url":"https://api.github.com/users/jfinkels/events{/privacy}","received_events_url":"https://api.github.com/users/jfinkels/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-05-20T01:53:45Z","updated_at":"2015-07-12T21:25:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/networkx/networkx/pulls/1534","html_url":"https://github.com/networkx/networkx/pull/1534","diff_url":"https://github.com/networkx/networkx/pull/1534.diff","patch_url":"https://github.com/networkx/networkx/pull/1534.patch"},"body":"As of the date of this commit, there is no way to get an arbitrary\r\nelement of an iterable like a set without modifying it (for example, as\r\nin `set.pop()`). The `peek()` function is more readable than writing\r\n\r\n    next(iter(S))\r\n\r\nwhenever an arbitrary element of an iterable is required.\r\n\r\nThis commit also makes a couple of PEP8 changes, but not many."},"comment":{"url":"https://api.github.com/repos/networkx/networkx/issues/comments/120763085","html_url":"https://github.com/networkx/networkx/pull/1534#issuecomment-120763085","issue_url":"https://api.github.com/repos/networkx/networkx/issues/1534","id":120763085,"user":{"login":"hagberg","id":187875,"avatar_url":"https://avatars.githubusercontent.com/u/187875?v=3","gravatar_id":"","url":"https://api.github.com/users/hagberg","html_url":"https://github.com/hagberg","followers_url":"https://api.github.com/users/hagberg/followers","following_url":"https://api.github.com/users/hagberg/following{/other_user}","gists_url":"https://api.github.com/users/hagberg/gists{/gist_id}","starred_url":"https://api.github.com/users/hagberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hagberg/subscriptions","organizations_url":"https://api.github.com/users/hagberg/orgs","repos_url":"https://api.github.com/users/hagberg/repos","events_url":"https://api.github.com/users/hagberg/events{/privacy}","received_events_url":"https://api.github.com/users/hagberg/received_events","type":"User","site_admin":false},"created_at":"2015-07-12T21:25:04Z","updated_at":"2015-07-12T21:25:04Z","body":"isinstance(x, collections.Iterator)?"}}