{"action":"created","comment":{"url":"https://api.github.com/repos/alibulota/data-structures/pulls/comments/24372378","id":24372378,"diff_hunk":"@@ -0,0 +1,77 @@\n+class Node(object):\n+    def __init__(self, data, next_node=None):\n+        self.data, self.next = data, next_node\n+\n+\n+class LinkedList(object):\n+    \"\"\"Create and object-->linked_list.\"\"\"\n+    def __init__(self, head=None):\n+        self.head = head\n+\n+    def insert(self, data):\n+        \"\"\"Put the given value into Node at head of list.\"\"\"\n+        inserted_node = Node(data)\n+        inserted_node.next = self.head\n+        self.head = inserted_node\n+\n+    def pop(self):\n+        \"\"\"Return node data, remove node from head of list.\"\"\"\n+        if self.head:\n+            value = self.head.data\n+            self.head = self.head.next\n+            return value\n+\n+    def size(self):\n+        \"\"\"Return length of linked list.\"\"\"\n+        current_size = self.head\n+        list_size = 0\n+        while current_size is not None:\n+            list_size = list_size + 1\n+            current_size = current_size.next\n+        print list_size","path":"linked_list.py","position":31,"original_position":31,"commit_id":"fc10b6081097d3a47a27a9407ab439f76f8cc403","original_commit_id":"fc10b6081097d3a47a27a9407ab439f76f8cc403","user":{"login":"cewing","id":417109,"avatar_url":"https://avatars.githubusercontent.com/u/417109?v=3","gravatar_id":"","url":"https://api.github.com/users/cewing","html_url":"https://github.com/cewing","followers_url":"https://api.github.com/users/cewing/followers","following_url":"https://api.github.com/users/cewing/following{/other_user}","gists_url":"https://api.github.com/users/cewing/gists{/gist_id}","starred_url":"https://api.github.com/users/cewing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cewing/subscriptions","organizations_url":"https://api.github.com/users/cewing/orgs","repos_url":"https://api.github.com/users/cewing/repos","events_url":"https://api.github.com/users/cewing/events{/privacy}","received_events_url":"https://api.github.com/users/cewing/received_events","type":"User","site_admin":false},"body":"Why do this?  I know it's helpful for debugging purposes, but it's a wasted operation.  Just return the value and print it in the context of calling `size` if you want to.","created_at":"2015-02-09T22:34:20Z","updated_at":"2015-02-09T22:34:20Z","html_url":"https://github.com/alibulota/data-structures/pull/2#discussion_r24372378","pull_request_url":"https://api.github.com/repos/alibulota/data-structures/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/alibulota/data-structures/pulls/comments/24372378"},"html":{"href":"https://github.com/alibulota/data-structures/pull/2#discussion_r24372378"},"pull_request":{"href":"https://api.github.com/repos/alibulota/data-structures/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/alibulota/data-structures/pulls/2","id":28897248,"html_url":"https://github.com/alibulota/data-structures/pull/2","diff_url":"https://github.com/alibulota/data-structures/pull/2.diff","patch_url":"https://github.com/alibulota/data-structures/pull/2.patch","issue_url":"https://api.github.com/repos/alibulota/data-structures/issues/2","number":2,"state":"closed","locked":false,"title":"Linked list","user":{"login":"alibulota","id":6208373,"avatar_url":"https://avatars.githubusercontent.com/u/6208373?v=3","gravatar_id":"","url":"https://api.github.com/users/alibulota","html_url":"https://github.com/alibulota","followers_url":"https://api.github.com/users/alibulota/followers","following_url":"https://api.github.com/users/alibulota/following{/other_user}","gists_url":"https://api.github.com/users/alibulota/gists{/gist_id}","starred_url":"https://api.github.com/users/alibulota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibulota/subscriptions","organizations_url":"https://api.github.com/users/alibulota/orgs","repos_url":"https://api.github.com/users/alibulota/repos","events_url":"https://api.github.com/users/alibulota/events{/privacy}","received_events_url":"https://api.github.com/users/alibulota/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-09T05:27:05Z","updated_at":"2015-02-09T22:34:20Z","closed_at":"2015-02-09T20:11:17Z","merged_at":"2015-02-09T20:11:17Z","merge_commit_sha":"6b6d52a39e677df1d83f84b64823c365f8f0815d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alibulota/data-structures/pulls/2/commits","review_comments_url":"https://api.github.com/repos/alibulota/data-structures/pulls/2/comments","review_comment_url":"https://api.github.com/repos/alibulota/data-structures/pulls/comments/{number}","comments_url":"https://api.github.com/repos/alibulota/data-structures/issues/2/comments","statuses_url":"https://api.github.com/repos/alibulota/data-structures/statuses/fc10b6081097d3a47a27a9407ab439f76f8cc403","head":{"label":"alibulota:linked_list","ref":"linked_list","sha":"fc10b6081097d3a47a27a9407ab439f76f8cc403","user":{"login":"alibulota","id":6208373,"avatar_url":"https://avatars.githubusercontent.com/u/6208373?v=3","gravatar_id":"","url":"https://api.github.com/users/alibulota","html_url":"https://github.com/alibulota","followers_url":"https://api.github.com/users/alibulota/followers","following_url":"https://api.github.com/users/alibulota/following{/other_user}","gists_url":"https://api.github.com/users/alibulota/gists{/gist_id}","starred_url":"https://api.github.com/users/alibulota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibulota/subscriptions","organizations_url":"https://api.github.com/users/alibulota/orgs","repos_url":"https://api.github.com/users/alibulota/repos","events_url":"https://api.github.com/users/alibulota/events{/privacy}","received_events_url":"https://api.github.com/users/alibulota/received_events","type":"User","site_admin":false},"repo":{"id":30509489,"name":"data-structures","full_name":"alibulota/data-structures","owner":{"login":"alibulota","id":6208373,"avatar_url":"https://avatars.githubusercontent.com/u/6208373?v=3","gravatar_id":"","url":"https://api.github.com/users/alibulota","html_url":"https://github.com/alibulota","followers_url":"https://api.github.com/users/alibulota/followers","following_url":"https://api.github.com/users/alibulota/following{/other_user}","gists_url":"https://api.github.com/users/alibulota/gists{/gist_id}","starred_url":"https://api.github.com/users/alibulota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibulota/subscriptions","organizations_url":"https://api.github.com/users/alibulota/orgs","repos_url":"https://api.github.com/users/alibulota/repos","events_url":"https://api.github.com/users/alibulota/events{/privacy}","received_events_url":"https://api.github.com/users/alibulota/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alibulota/data-structures","description":"Data Structures and Algorithms in Python","fork":false,"url":"https://api.github.com/repos/alibulota/data-structures","forks_url":"https://api.github.com/repos/alibulota/data-structures/forks","keys_url":"https://api.github.com/repos/alibulota/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alibulota/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alibulota/data-structures/teams","hooks_url":"https://api.github.com/repos/alibulota/data-structures/hooks","issue_events_url":"https://api.github.com/repos/alibulota/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/alibulota/data-structures/events","assignees_url":"https://api.github.com/repos/alibulota/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/alibulota/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/alibulota/data-structures/tags","blobs_url":"https://api.github.com/repos/alibulota/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alibulota/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alibulota/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/alibulota/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alibulota/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/alibulota/data-structures/languages","stargazers_url":"https://api.github.com/repos/alibulota/data-structures/stargazers","contributors_url":"https://api.github.com/repos/alibulota/data-structures/contributors","subscribers_url":"https://api.github.com/repos/alibulota/data-structures/subscribers","subscription_url":"https://api.github.com/repos/alibulota/data-structures/subscription","commits_url":"https://api.github.com/repos/alibulota/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/alibulota/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/alibulota/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/alibulota/data-structures/issues/comments/{number}","contents_url":"https://api.github.com/repos/alibulota/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/alibulota/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alibulota/data-structures/merges","archive_url":"https://api.github.com/repos/alibulota/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alibulota/data-structures/downloads","issues_url":"https://api.github.com/repos/alibulota/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/alibulota/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/alibulota/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/alibulota/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alibulota/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/alibulota/data-structures/releases{/id}","created_at":"2015-02-08T23:09:32Z","updated_at":"2015-02-09T20:11:19Z","pushed_at":"2015-02-09T20:11:19Z","git_url":"git://github.com/alibulota/data-structures.git","ssh_url":"git@github.com:alibulota/data-structures.git","clone_url":"https://github.com/alibulota/data-structures.git","svn_url":"https://github.com/alibulota/data-structures","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"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":"alibulota:master","ref":"master","sha":"e30bd9090355dc564a0671472db7b224b5a83a43","user":{"login":"alibulota","id":6208373,"avatar_url":"https://avatars.githubusercontent.com/u/6208373?v=3","gravatar_id":"","url":"https://api.github.com/users/alibulota","html_url":"https://github.com/alibulota","followers_url":"https://api.github.com/users/alibulota/followers","following_url":"https://api.github.com/users/alibulota/following{/other_user}","gists_url":"https://api.github.com/users/alibulota/gists{/gist_id}","starred_url":"https://api.github.com/users/alibulota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibulota/subscriptions","organizations_url":"https://api.github.com/users/alibulota/orgs","repos_url":"https://api.github.com/users/alibulota/repos","events_url":"https://api.github.com/users/alibulota/events{/privacy}","received_events_url":"https://api.github.com/users/alibulota/received_events","type":"User","site_admin":false},"repo":{"id":30509489,"name":"data-structures","full_name":"alibulota/data-structures","owner":{"login":"alibulota","id":6208373,"avatar_url":"https://avatars.githubusercontent.com/u/6208373?v=3","gravatar_id":"","url":"https://api.github.com/users/alibulota","html_url":"https://github.com/alibulota","followers_url":"https://api.github.com/users/alibulota/followers","following_url":"https://api.github.com/users/alibulota/following{/other_user}","gists_url":"https://api.github.com/users/alibulota/gists{/gist_id}","starred_url":"https://api.github.com/users/alibulota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibulota/subscriptions","organizations_url":"https://api.github.com/users/alibulota/orgs","repos_url":"https://api.github.com/users/alibulota/repos","events_url":"https://api.github.com/users/alibulota/events{/privacy}","received_events_url":"https://api.github.com/users/alibulota/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alibulota/data-structures","description":"Data Structures and Algorithms in Python","fork":false,"url":"https://api.github.com/repos/alibulota/data-structures","forks_url":"https://api.github.com/repos/alibulota/data-structures/forks","keys_url":"https://api.github.com/repos/alibulota/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alibulota/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alibulota/data-structures/teams","hooks_url":"https://api.github.com/repos/alibulota/data-structures/hooks","issue_events_url":"https://api.github.com/repos/alibulota/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/alibulota/data-structures/events","assignees_url":"https://api.github.com/repos/alibulota/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/alibulota/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/alibulota/data-structures/tags","blobs_url":"https://api.github.com/repos/alibulota/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alibulota/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alibulota/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/alibulota/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alibulota/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/alibulota/data-structures/languages","stargazers_url":"https://api.github.com/repos/alibulota/data-structures/stargazers","contributors_url":"https://api.github.com/repos/alibulota/data-structures/contributors","subscribers_url":"https://api.github.com/repos/alibulota/data-structures/subscribers","subscription_url":"https://api.github.com/repos/alibulota/data-structures/subscription","commits_url":"https://api.github.com/repos/alibulota/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/alibulota/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/alibulota/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/alibulota/data-structures/issues/comments/{number}","contents_url":"https://api.github.com/repos/alibulota/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/alibulota/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alibulota/data-structures/merges","archive_url":"https://api.github.com/repos/alibulota/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alibulota/data-structures/downloads","issues_url":"https://api.github.com/repos/alibulota/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/alibulota/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/alibulota/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/alibulota/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alibulota/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/alibulota/data-structures/releases{/id}","created_at":"2015-02-08T23:09:32Z","updated_at":"2015-02-09T20:11:19Z","pushed_at":"2015-02-09T20:11:19Z","git_url":"git://github.com/alibulota/data-structures.git","ssh_url":"git@github.com:alibulota/data-structures.git","clone_url":"https://github.com/alibulota/data-structures.git","svn_url":"https://github.com/alibulota/data-structures","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"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"}},"_links":{"self":{"href":"https://api.github.com/repos/alibulota/data-structures/pulls/2"},"html":{"href":"https://github.com/alibulota/data-structures/pull/2"},"issue":{"href":"https://api.github.com/repos/alibulota/data-structures/issues/2"},"comments":{"href":"https://api.github.com/repos/alibulota/data-structures/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/alibulota/data-structures/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/alibulota/data-structures/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/alibulota/data-structures/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/alibulota/data-structures/statuses/fc10b6081097d3a47a27a9407ab439f76f8cc403"}}}}