{"action":"created","comment":{"url":"https://api.github.com/repos/kennethreitz/requests/pulls/comments/63547779","id":63547779,"diff_hunk":"@@ -89,3 +89,18 @@\n         setattr(codes, title, code)\n         if not title.startswith('\\\\'):\n             setattr(codes, title.upper(), code)\n+\n+_success = {\n+    200,\n+    201,\n+    202,\n+    203,\n+    204,\n+    205,\n+    206,\n+    207,\n+    208,\n+    226,\n+}\n+\n+setattr(codes, 'success', _success)","path":"requests/status_codes.py","position":18,"original_position":18,"commit_id":"d7b664c76837342bde2725d1888f0cc2a58025e7","original_commit_id":"d7b664c76837342bde2725d1888f0cc2a58025e7","user":{"login":"sigmavirus24","id":240830,"avatar_url":"https://avatars.githubusercontent.com/u/240830?v=3","gravatar_id":"","url":"https://api.github.com/users/sigmavirus24","html_url":"https://github.com/sigmavirus24","followers_url":"https://api.github.com/users/sigmavirus24/followers","following_url":"https://api.github.com/users/sigmavirus24/following{/other_user}","gists_url":"https://api.github.com/users/sigmavirus24/gists{/gist_id}","starred_url":"https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigmavirus24/subscriptions","organizations_url":"https://api.github.com/users/sigmavirus24/orgs","repos_url":"https://api.github.com/users/sigmavirus24/repos","events_url":"https://api.github.com/users/sigmavirus24/events{/privacy}","received_events_url":"https://api.github.com/users/sigmavirus24/received_events","type":"User","site_admin":false},"body":"Oh, also note that on Py26, you can't use set literal notation. You have to do\r\n\r\n```py\r\nsuccess_set = set([\r\n    200,\r\n    201,\r\n    # ...\r\n])\r\n```","created_at":"2016-05-17T15:43:28Z","updated_at":"2016-05-17T15:43:28Z","html_url":"https://github.com/kennethreitz/requests/pull/3198#discussion_r63547779","pull_request_url":"https://api.github.com/repos/kennethreitz/requests/pulls/3198","_links":{"self":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/comments/63547779"},"html":{"href":"https://github.com/kennethreitz/requests/pull/3198#discussion_r63547779"},"pull_request":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/3198"}}},"pull_request":{"url":"https://api.github.com/repos/kennethreitz/requests/pulls/3198","id":70266462,"html_url":"https://github.com/kennethreitz/requests/pull/3198","diff_url":"https://github.com/kennethreitz/requests/pull/3198.diff","patch_url":"https://github.com/kennethreitz/requests/pull/3198.patch","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/3198","number":3198,"state":"open","locked":false,"title":"Issue #2645 - Change behavior of Response.ok","user":{"login":"Itwilloutliveyou","id":15115673,"avatar_url":"https://avatars.githubusercontent.com/u/15115673?v=3","gravatar_id":"","url":"https://api.github.com/users/Itwilloutliveyou","html_url":"https://github.com/Itwilloutliveyou","followers_url":"https://api.github.com/users/Itwilloutliveyou/followers","following_url":"https://api.github.com/users/Itwilloutliveyou/following{/other_user}","gists_url":"https://api.github.com/users/Itwilloutliveyou/gists{/gist_id}","starred_url":"https://api.github.com/users/Itwilloutliveyou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Itwilloutliveyou/subscriptions","organizations_url":"https://api.github.com/users/Itwilloutliveyou/orgs","repos_url":"https://api.github.com/users/Itwilloutliveyou/repos","events_url":"https://api.github.com/users/Itwilloutliveyou/events{/privacy}","received_events_url":"https://api.github.com/users/Itwilloutliveyou/received_events","type":"User","site_admin":false},"body":"As discussed on issue #2645, I added a success attribute to\r\nrequests.codes. Now, Response.ok checks if the response's status code\r\nis listed on requests.codes.success.","created_at":"2016-05-16T21:41:53Z","updated_at":"2016-05-17T15:43:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37309713ea4df983ba9608ada2359482cf9fdf05","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kennethreitz/requests/pulls/3198/commits","review_comments_url":"https://api.github.com/repos/kennethreitz/requests/pulls/3198/comments","review_comment_url":"https://api.github.com/repos/kennethreitz/requests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/3198/comments","statuses_url":"https://api.github.com/repos/kennethreitz/requests/statuses/d7b664c76837342bde2725d1888f0cc2a58025e7","head":{"label":"Itwilloutliveyou:master","ref":"master","sha":"d7b664c76837342bde2725d1888f0cc2a58025e7","user":{"login":"Itwilloutliveyou","id":15115673,"avatar_url":"https://avatars.githubusercontent.com/u/15115673?v=3","gravatar_id":"","url":"https://api.github.com/users/Itwilloutliveyou","html_url":"https://github.com/Itwilloutliveyou","followers_url":"https://api.github.com/users/Itwilloutliveyou/followers","following_url":"https://api.github.com/users/Itwilloutliveyou/following{/other_user}","gists_url":"https://api.github.com/users/Itwilloutliveyou/gists{/gist_id}","starred_url":"https://api.github.com/users/Itwilloutliveyou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Itwilloutliveyou/subscriptions","organizations_url":"https://api.github.com/users/Itwilloutliveyou/orgs","repos_url":"https://api.github.com/users/Itwilloutliveyou/repos","events_url":"https://api.github.com/users/Itwilloutliveyou/events{/privacy}","received_events_url":"https://api.github.com/users/Itwilloutliveyou/received_events","type":"User","site_admin":false},"repo":{"id":58841780,"name":"requests","full_name":"Itwilloutliveyou/requests","owner":{"login":"Itwilloutliveyou","id":15115673,"avatar_url":"https://avatars.githubusercontent.com/u/15115673?v=3","gravatar_id":"","url":"https://api.github.com/users/Itwilloutliveyou","html_url":"https://github.com/Itwilloutliveyou","followers_url":"https://api.github.com/users/Itwilloutliveyou/followers","following_url":"https://api.github.com/users/Itwilloutliveyou/following{/other_user}","gists_url":"https://api.github.com/users/Itwilloutliveyou/gists{/gist_id}","starred_url":"https://api.github.com/users/Itwilloutliveyou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Itwilloutliveyou/subscriptions","organizations_url":"https://api.github.com/users/Itwilloutliveyou/orgs","repos_url":"https://api.github.com/users/Itwilloutliveyou/repos","events_url":"https://api.github.com/users/Itwilloutliveyou/events{/privacy}","received_events_url":"https://api.github.com/users/Itwilloutliveyou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Itwilloutliveyou/requests","description":"Python HTTP Requests for Humans™","fork":true,"url":"https://api.github.com/repos/Itwilloutliveyou/requests","forks_url":"https://api.github.com/repos/Itwilloutliveyou/requests/forks","keys_url":"https://api.github.com/repos/Itwilloutliveyou/requests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Itwilloutliveyou/requests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Itwilloutliveyou/requests/teams","hooks_url":"https://api.github.com/repos/Itwilloutliveyou/requests/hooks","issue_events_url":"https://api.github.com/repos/Itwilloutliveyou/requests/issues/events{/number}","events_url":"https://api.github.com/repos/Itwilloutliveyou/requests/events","assignees_url":"https://api.github.com/repos/Itwilloutliveyou/requests/assignees{/user}","branches_url":"https://api.github.com/repos/Itwilloutliveyou/requests/branches{/branch}","tags_url":"https://api.github.com/repos/Itwilloutliveyou/requests/tags","blobs_url":"https://api.github.com/repos/Itwilloutliveyou/requests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Itwilloutliveyou/requests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Itwilloutliveyou/requests/git/refs{/sha}","trees_url":"https://api.github.com/repos/Itwilloutliveyou/requests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Itwilloutliveyou/requests/statuses/{sha}","languages_url":"https://api.github.com/repos/Itwilloutliveyou/requests/languages","stargazers_url":"https://api.github.com/repos/Itwilloutliveyou/requests/stargazers","contributors_url":"https://api.github.com/repos/Itwilloutliveyou/requests/contributors","subscribers_url":"https://api.github.com/repos/Itwilloutliveyou/requests/subscribers","subscription_url":"https://api.github.com/repos/Itwilloutliveyou/requests/subscription","commits_url":"https://api.github.com/repos/Itwilloutliveyou/requests/commits{/sha}","git_commits_url":"https://api.github.com/repos/Itwilloutliveyou/requests/git/commits{/sha}","comments_url":"https://api.github.com/repos/Itwilloutliveyou/requests/comments{/number}","issue_comment_url":"https://api.github.com/repos/Itwilloutliveyou/requests/issues/comments{/number}","contents_url":"https://api.github.com/repos/Itwilloutliveyou/requests/contents/{+path}","compare_url":"https://api.github.com/repos/Itwilloutliveyou/requests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Itwilloutliveyou/requests/merges","archive_url":"https://api.github.com/repos/Itwilloutliveyou/requests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Itwilloutliveyou/requests/downloads","issues_url":"https://api.github.com/repos/Itwilloutliveyou/requests/issues{/number}","pulls_url":"https://api.github.com/repos/Itwilloutliveyou/requests/pulls{/number}","milestones_url":"https://api.github.com/repos/Itwilloutliveyou/requests/milestones{/number}","notifications_url":"https://api.github.com/repos/Itwilloutliveyou/requests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Itwilloutliveyou/requests/labels{/name}","releases_url":"https://api.github.com/repos/Itwilloutliveyou/requests/releases{/id}","deployments_url":"https://api.github.com/repos/Itwilloutliveyou/requests/deployments","created_at":"2016-05-15T03:14:29Z","updated_at":"2016-05-15T03:14:32Z","pushed_at":"2016-05-16T21:38:58Z","git_url":"git://github.com/Itwilloutliveyou/requests.git","ssh_url":"git@github.com:Itwilloutliveyou/requests.git","clone_url":"https://github.com/Itwilloutliveyou/requests.git","svn_url":"https://github.com/Itwilloutliveyou/requests","homepage":"python-requests.org","size":5376,"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":"kennethreitz:master","ref":"master","sha":"12e36318272bf77c079774a5c97c5abf23e634bb","user":{"login":"kennethreitz","id":119893,"avatar_url":"https://avatars.githubusercontent.com/u/119893?v=3","gravatar_id":"","url":"https://api.github.com/users/kennethreitz","html_url":"https://github.com/kennethreitz","followers_url":"https://api.github.com/users/kennethreitz/followers","following_url":"https://api.github.com/users/kennethreitz/following{/other_user}","gists_url":"https://api.github.com/users/kennethreitz/gists{/gist_id}","starred_url":"https://api.github.com/users/kennethreitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennethreitz/subscriptions","organizations_url":"https://api.github.com/users/kennethreitz/orgs","repos_url":"https://api.github.com/users/kennethreitz/repos","events_url":"https://api.github.com/users/kennethreitz/events{/privacy}","received_events_url":"https://api.github.com/users/kennethreitz/received_events","type":"User","site_admin":false},"repo":{"id":1362490,"name":"requests","full_name":"kennethreitz/requests","owner":{"login":"kennethreitz","id":119893,"avatar_url":"https://avatars.githubusercontent.com/u/119893?v=3","gravatar_id":"","url":"https://api.github.com/users/kennethreitz","html_url":"https://github.com/kennethreitz","followers_url":"https://api.github.com/users/kennethreitz/followers","following_url":"https://api.github.com/users/kennethreitz/following{/other_user}","gists_url":"https://api.github.com/users/kennethreitz/gists{/gist_id}","starred_url":"https://api.github.com/users/kennethreitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennethreitz/subscriptions","organizations_url":"https://api.github.com/users/kennethreitz/orgs","repos_url":"https://api.github.com/users/kennethreitz/repos","events_url":"https://api.github.com/users/kennethreitz/events{/privacy}","received_events_url":"https://api.github.com/users/kennethreitz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kennethreitz/requests","description":"Python HTTP Requests for Humans™","fork":false,"url":"https://api.github.com/repos/kennethreitz/requests","forks_url":"https://api.github.com/repos/kennethreitz/requests/forks","keys_url":"https://api.github.com/repos/kennethreitz/requests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kennethreitz/requests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kennethreitz/requests/teams","hooks_url":"https://api.github.com/repos/kennethreitz/requests/hooks","issue_events_url":"https://api.github.com/repos/kennethreitz/requests/issues/events{/number}","events_url":"https://api.github.com/repos/kennethreitz/requests/events","assignees_url":"https://api.github.com/repos/kennethreitz/requests/assignees{/user}","branches_url":"https://api.github.com/repos/kennethreitz/requests/branches{/branch}","tags_url":"https://api.github.com/repos/kennethreitz/requests/tags","blobs_url":"https://api.github.com/repos/kennethreitz/requests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kennethreitz/requests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kennethreitz/requests/git/refs{/sha}","trees_url":"https://api.github.com/repos/kennethreitz/requests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kennethreitz/requests/statuses/{sha}","languages_url":"https://api.github.com/repos/kennethreitz/requests/languages","stargazers_url":"https://api.github.com/repos/kennethreitz/requests/stargazers","contributors_url":"https://api.github.com/repos/kennethreitz/requests/contributors","subscribers_url":"https://api.github.com/repos/kennethreitz/requests/subscribers","subscription_url":"https://api.github.com/repos/kennethreitz/requests/subscription","commits_url":"https://api.github.com/repos/kennethreitz/requests/commits{/sha}","git_commits_url":"https://api.github.com/repos/kennethreitz/requests/git/commits{/sha}","comments_url":"https://api.github.com/repos/kennethreitz/requests/comments{/number}","issue_comment_url":"https://api.github.com/repos/kennethreitz/requests/issues/comments{/number}","contents_url":"https://api.github.com/repos/kennethreitz/requests/contents/{+path}","compare_url":"https://api.github.com/repos/kennethreitz/requests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kennethreitz/requests/merges","archive_url":"https://api.github.com/repos/kennethreitz/requests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kennethreitz/requests/downloads","issues_url":"https://api.github.com/repos/kennethreitz/requests/issues{/number}","pulls_url":"https://api.github.com/repos/kennethreitz/requests/pulls{/number}","milestones_url":"https://api.github.com/repos/kennethreitz/requests/milestones{/number}","notifications_url":"https://api.github.com/repos/kennethreitz/requests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kennethreitz/requests/labels{/name}","releases_url":"https://api.github.com/repos/kennethreitz/requests/releases{/id}","deployments_url":"https://api.github.com/repos/kennethreitz/requests/deployments","created_at":"2011-02-13T18:38:17Z","updated_at":"2016-05-17T08:29:42Z","pushed_at":"2016-05-17T15:42:32Z","git_url":"git://github.com/kennethreitz/requests.git","ssh_url":"git@github.com:kennethreitz/requests.git","clone_url":"https://github.com/kennethreitz/requests.git","svn_url":"https://github.com/kennethreitz/requests","homepage":"python-requests.org","size":9863,"stargazers_count":18984,"watchers_count":18984,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3326,"mirror_url":null,"open_issues_count":90,"forks":3326,"open_issues":90,"watchers":18984,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/3198"},"html":{"href":"https://github.com/kennethreitz/requests/pull/3198"},"issue":{"href":"https://api.github.com/repos/kennethreitz/requests/issues/3198"},"comments":{"href":"https://api.github.com/repos/kennethreitz/requests/issues/3198/comments"},"review_comments":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/3198/comments"},"review_comment":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kennethreitz/requests/pulls/3198/commits"},"statuses":{"href":"https://api.github.com/repos/kennethreitz/requests/statuses/d7b664c76837342bde2725d1888f0cc2a58025e7"}}}}