{"action":"created","comment":{"url":"https://api.github.com/repos/wenima/data-structures/pulls/comments/92931473","pull_request_review_id":13455283,"id":92931473,"diff_hunk":"@@ -0,0 +1,125 @@\n+\"\"\"Create a Double Linked List Data Structure.\"\"\"\n+\n+\n+class Dbl_Node(object):\n+    \"\"\"Create Node objects for use in a Linked List data structure.\n+\n+    Attributes:\n+    value:      A value stored in the Node.\n+    nxt:        Pointer to the next Node, used in a Linked List or Stack\n+                data structure.\n+    \"\"\"\n+    def __init__(self, value=None, nxt=None, prev=None):\n+        \"\"\"Initialize a Node type object.\"\"\"\n+        self.value = value\n+        self.nxt = nxt\n+        self.prev = prev\n+\n+\n+class Dbl_Linked_List(object):\n+    \"\"\"Double Linked List style Data Structure\n+\n+        Attributes:\n+        head:       Always the most recent item added to a Linked List.\n+        _size:      The length of the Linked List or number of Nodes stored\n+                    in the list.\n+\n+        Methods:\n+\n+        push(value):    Given a value, add a new Node object to a Linked List.\n+\n+        append(value):  Given a value, adds it at the end of the line.\n+\n+        pop():          Pop the head Node off the list, return the value.\n+\n+        shift():        will remove the last value from the line and return it.\n+\n+        remove(val):    Given a Node, remove that Node from the Linked List.  Else,\n+                        raise a ValueError.\n+        \"\"\"\n+\n+    def __init__(self, maybe_an_iterable=None):\n+        \"\"\"Intialize a doubly linked List Object.\"\"\"\n+        self.head = None\n+        self.tail = None\n+        self._size = 0\n+        if maybe_an_iterable:\n+            try:\n+                for value in maybe_an_iterable:\n+                    self.push(value)\n+                nodes = [node for node in self._iterate_from(self.head)]\n+                self.tail = nodes[-1]\n+            except TypeError:\n+                self.push(maybe_an_iterable)\n+\n+    def push(self, value):\n+        \"\"\"Add a node at the beginning of the line.\"\"\"\n+        self.head = Dbl_Node(value, self.head)\n+        self._size += 1\n+        if self._size == 1:\n+            self.tail = self.head\n+        elif self._size == 2:\n+            nodes = [node for node in self._iterate_from(self.head)]\n+            self.tail = nodes[-1]\n+            nodes[-1].prev = self.head\n+        else:\n+            self.head.nxt.prev = self.head\n+\n+    def pop(self):\n+        \"\"\"Pop the first value off the head of LL and return it.\"\"\"\n+        if self.head is None:\n+            raise IndexError(\"Cannot pop from an empty Linked List.\")\n+        val = self.head.value\n+        self.head = self.head.nxt\n+        self.head.prev = None","path":"src/dbl_linked_list.py","position":74,"original_position":74,"commit_id":"f6152a9b784502956dd6f7d6aba3831c4b70d2b2","original_commit_id":"f6152a9b784502956dd6f7d6aba3831c4b70d2b2","user":{"login":"WillWeatherford","id":7210312,"avatar_url":"https://avatars.githubusercontent.com/u/7210312?v=3","gravatar_id":"","url":"https://api.github.com/users/WillWeatherford","html_url":"https://github.com/WillWeatherford","followers_url":"https://api.github.com/users/WillWeatherford/followers","following_url":"https://api.github.com/users/WillWeatherford/following{/other_user}","gists_url":"https://api.github.com/users/WillWeatherford/gists{/gist_id}","starred_url":"https://api.github.com/users/WillWeatherford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WillWeatherford/subscriptions","organizations_url":"https://api.github.com/users/WillWeatherford/orgs","repos_url":"https://api.github.com/users/WillWeatherford/repos","events_url":"https://api.github.com/users/WillWeatherford/events{/privacy}","received_events_url":"https://api.github.com/users/WillWeatherford/received_events","type":"User","site_admin":false},"body":"Here's a big vulnerability in your program. Your tests don't cover the scenario where you pop from a list when there is only one item in it.\r\n\r\nConsider also that you need to test and account for a similar situation with `shift`!","created_at":"2016-12-18T00:19:13Z","updated_at":"2016-12-18T00:19:13Z","html_url":"https://github.com/wenima/data-structures/pull/12#discussion_r92931473","pull_request_url":"https://api.github.com/repos/wenima/data-structures/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/wenima/data-structures/pulls/comments/92931473"},"html":{"href":"https://github.com/wenima/data-structures/pull/12#discussion_r92931473"},"pull_request":{"href":"https://api.github.com/repos/wenima/data-structures/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/wenima/data-structures/pulls/12","id":98103389,"html_url":"https://github.com/wenima/data-structures/pull/12","diff_url":"https://github.com/wenima/data-structures/pull/12.diff","patch_url":"https://github.com/wenima/data-structures/pull/12.patch","issue_url":"https://api.github.com/repos/wenima/data-structures/issues/12","number":12,"state":"open","locked":false,"title":"branch to submit pull request on for assignment to implement a doubly-linked-list","user":{"login":"wenima","id":22766301,"avatar_url":"https://avatars.githubusercontent.com/u/22766301?v=3","gravatar_id":"","url":"https://api.github.com/users/wenima","html_url":"https://github.com/wenima","followers_url":"https://api.github.com/users/wenima/followers","following_url":"https://api.github.com/users/wenima/following{/other_user}","gists_url":"https://api.github.com/users/wenima/gists{/gist_id}","starred_url":"https://api.github.com/users/wenima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenima/subscriptions","organizations_url":"https://api.github.com/users/wenima/orgs","repos_url":"https://api.github.com/users/wenima/repos","events_url":"https://api.github.com/users/wenima/events{/privacy}","received_events_url":"https://api.github.com/users/wenima/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-15T08:05:43Z","updated_at":"2016-12-18T00:19:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bec678d6d67af08010c94742da91b41bb600306b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wenima/data-structures/pulls/12/commits","review_comments_url":"https://api.github.com/repos/wenima/data-structures/pulls/12/comments","review_comment_url":"https://api.github.com/repos/wenima/data-structures/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wenima/data-structures/issues/12/comments","statuses_url":"https://api.github.com/repos/wenima/data-structures/statuses/f6152a9b784502956dd6f7d6aba3831c4b70d2b2","head":{"label":"wenima:dll","ref":"dll","sha":"f6152a9b784502956dd6f7d6aba3831c4b70d2b2","user":{"login":"wenima","id":22766301,"avatar_url":"https://avatars.githubusercontent.com/u/22766301?v=3","gravatar_id":"","url":"https://api.github.com/users/wenima","html_url":"https://github.com/wenima","followers_url":"https://api.github.com/users/wenima/followers","following_url":"https://api.github.com/users/wenima/following{/other_user}","gists_url":"https://api.github.com/users/wenima/gists{/gist_id}","starred_url":"https://api.github.com/users/wenima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenima/subscriptions","organizations_url":"https://api.github.com/users/wenima/orgs","repos_url":"https://api.github.com/users/wenima/repos","events_url":"https://api.github.com/users/wenima/events{/privacy}","received_events_url":"https://api.github.com/users/wenima/received_events","type":"User","site_admin":false},"repo":{"id":76295641,"name":"data-structures","full_name":"wenima/data-structures","owner":{"login":"wenima","id":22766301,"avatar_url":"https://avatars.githubusercontent.com/u/22766301?v=3","gravatar_id":"","url":"https://api.github.com/users/wenima","html_url":"https://github.com/wenima","followers_url":"https://api.github.com/users/wenima/followers","following_url":"https://api.github.com/users/wenima/following{/other_user}","gists_url":"https://api.github.com/users/wenima/gists{/gist_id}","starred_url":"https://api.github.com/users/wenima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenima/subscriptions","organizations_url":"https://api.github.com/users/wenima/orgs","repos_url":"https://api.github.com/users/wenima/repos","events_url":"https://api.github.com/users/wenima/events{/privacy}","received_events_url":"https://api.github.com/users/wenima/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wenima/data-structures","description":"used for all data structure assingments","fork":false,"url":"https://api.github.com/repos/wenima/data-structures","forks_url":"https://api.github.com/repos/wenima/data-structures/forks","keys_url":"https://api.github.com/repos/wenima/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wenima/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wenima/data-structures/teams","hooks_url":"https://api.github.com/repos/wenima/data-structures/hooks","issue_events_url":"https://api.github.com/repos/wenima/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/wenima/data-structures/events","assignees_url":"https://api.github.com/repos/wenima/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/wenima/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/wenima/data-structures/tags","blobs_url":"https://api.github.com/repos/wenima/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wenima/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wenima/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/wenima/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wenima/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/wenima/data-structures/languages","stargazers_url":"https://api.github.com/repos/wenima/data-structures/stargazers","contributors_url":"https://api.github.com/repos/wenima/data-structures/contributors","subscribers_url":"https://api.github.com/repos/wenima/data-structures/subscribers","subscription_url":"https://api.github.com/repos/wenima/data-structures/subscription","commits_url":"https://api.github.com/repos/wenima/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/wenima/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/wenima/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/wenima/data-structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/wenima/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/wenima/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wenima/data-structures/merges","archive_url":"https://api.github.com/repos/wenima/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wenima/data-structures/downloads","issues_url":"https://api.github.com/repos/wenima/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/wenima/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/wenima/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/wenima/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wenima/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/wenima/data-structures/releases{/id}","deployments_url":"https://api.github.com/repos/wenima/data-structures/deployments","created_at":"2016-12-12T21:08:04Z","updated_at":"2016-12-12T21:08:04Z","pushed_at":"2016-12-17T19:40:15Z","git_url":"git://github.com/wenima/data-structures.git","ssh_url":"git@github.com:wenima/data-structures.git","clone_url":"https://github.com/wenima/data-structures.git","svn_url":"https://github.com/wenima/data-structures","homepage":null,"size":89,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":0,"default_branch":"master"}},"base":{"label":"wenima:master","ref":"master","sha":"0ca56848efc93716eb02982378170c458a10c163","user":{"login":"wenima","id":22766301,"avatar_url":"https://avatars.githubusercontent.com/u/22766301?v=3","gravatar_id":"","url":"https://api.github.com/users/wenima","html_url":"https://github.com/wenima","followers_url":"https://api.github.com/users/wenima/followers","following_url":"https://api.github.com/users/wenima/following{/other_user}","gists_url":"https://api.github.com/users/wenima/gists{/gist_id}","starred_url":"https://api.github.com/users/wenima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenima/subscriptions","organizations_url":"https://api.github.com/users/wenima/orgs","repos_url":"https://api.github.com/users/wenima/repos","events_url":"https://api.github.com/users/wenima/events{/privacy}","received_events_url":"https://api.github.com/users/wenima/received_events","type":"User","site_admin":false},"repo":{"id":76295641,"name":"data-structures","full_name":"wenima/data-structures","owner":{"login":"wenima","id":22766301,"avatar_url":"https://avatars.githubusercontent.com/u/22766301?v=3","gravatar_id":"","url":"https://api.github.com/users/wenima","html_url":"https://github.com/wenima","followers_url":"https://api.github.com/users/wenima/followers","following_url":"https://api.github.com/users/wenima/following{/other_user}","gists_url":"https://api.github.com/users/wenima/gists{/gist_id}","starred_url":"https://api.github.com/users/wenima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenima/subscriptions","organizations_url":"https://api.github.com/users/wenima/orgs","repos_url":"https://api.github.com/users/wenima/repos","events_url":"https://api.github.com/users/wenima/events{/privacy}","received_events_url":"https://api.github.com/users/wenima/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wenima/data-structures","description":"used for all data structure assingments","fork":false,"url":"https://api.github.com/repos/wenima/data-structures","forks_url":"https://api.github.com/repos/wenima/data-structures/forks","keys_url":"https://api.github.com/repos/wenima/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wenima/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wenima/data-structures/teams","hooks_url":"https://api.github.com/repos/wenima/data-structures/hooks","issue_events_url":"https://api.github.com/repos/wenima/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/wenima/data-structures/events","assignees_url":"https://api.github.com/repos/wenima/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/wenima/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/wenima/data-structures/tags","blobs_url":"https://api.github.com/repos/wenima/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wenima/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wenima/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/wenima/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wenima/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/wenima/data-structures/languages","stargazers_url":"https://api.github.com/repos/wenima/data-structures/stargazers","contributors_url":"https://api.github.com/repos/wenima/data-structures/contributors","subscribers_url":"https://api.github.com/repos/wenima/data-structures/subscribers","subscription_url":"https://api.github.com/repos/wenima/data-structures/subscription","commits_url":"https://api.github.com/repos/wenima/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/wenima/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/wenima/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/wenima/data-structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/wenima/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/wenima/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wenima/data-structures/merges","archive_url":"https://api.github.com/repos/wenima/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wenima/data-structures/downloads","issues_url":"https://api.github.com/repos/wenima/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/wenima/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/wenima/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/wenima/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wenima/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/wenima/data-structures/releases{/id}","deployments_url":"https://api.github.com/repos/wenima/data-structures/deployments","created_at":"2016-12-12T21:08:04Z","updated_at":"2016-12-12T21:08:04Z","pushed_at":"2016-12-17T19:40:15Z","git_url":"git://github.com/wenima/data-structures.git","ssh_url":"git@github.com:wenima/data-structures.git","clone_url":"https://github.com/wenima/data-structures.git","svn_url":"https://github.com/wenima/data-structures","homepage":null,"size":89,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wenima/data-structures/pulls/12"},"html":{"href":"https://github.com/wenima/data-structures/pull/12"},"issue":{"href":"https://api.github.com/repos/wenima/data-structures/issues/12"},"comments":{"href":"https://api.github.com/repos/wenima/data-structures/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/wenima/data-structures/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/wenima/data-structures/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wenima/data-structures/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/wenima/data-structures/statuses/f6152a9b784502956dd6f7d6aba3831c4b70d2b2"}}}}
{"actor":{"display_login":"WillWeatherford"}}