{"action":"created","comment":{"url":"https://api.github.com/repos/falconry/falcon/pulls/comments/65752218","id":65752218,"diff_hunk":"@@ -210,3 +214,33 @@ def get_bound_method(obj, method_name):\n             raise AttributeError(msg)\n \n     return method\n+\n+\n+def get_http_status(status_code):\n+    \"\"\"Gets both the http status code and description from just a code\n+\n+    Args:\n+        status_code: integer or string that can be converted to an integer\n+\n+    Returns:\n+        str: status code e.g. \"404 Not Found\"\n+\n+    Raises:\n+        ValueError: the value entered could not be converted to an integer\n+\n+    \"\"\"\n+    # sanitize inputs\n+    try:\n+        code = decimal.Decimal(str(status_code))  # Decimal can validate values like \"401.1\"","path":"falcon/util/misc.py","position":45,"original_position":45,"commit_id":"53acd9380f9ce0624d7d7f73e31a3581151898c4","original_commit_id":"53acd9380f9ce0624d7d7f73e31a3581151898c4","user":{"login":"kgriffs","id":719939,"avatar_url":"https://avatars.githubusercontent.com/u/719939?v=3","gravatar_id":"","url":"https://api.github.com/users/kgriffs","html_url":"https://github.com/kgriffs","followers_url":"https://api.github.com/users/kgriffs/followers","following_url":"https://api.github.com/users/kgriffs/following{/other_user}","gists_url":"https://api.github.com/users/kgriffs/gists{/gist_id}","starred_url":"https://api.github.com/users/kgriffs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgriffs/subscriptions","organizations_url":"https://api.github.com/users/kgriffs/orgs","repos_url":"https://api.github.com/users/kgriffs/repos","events_url":"https://api.github.com/users/kgriffs/events{/privacy}","received_events_url":"https://api.github.com/users/kgriffs/received_events","type":"User","site_admin":false},"body":"If we are expecting either a number or a string, do we need to pass this through `str()`? Also, can we just use `float()` here instead of `Decimal()`, since the value is going to be truncated anyway by `int()`?","created_at":"2016-06-03T18:13:35Z","updated_at":"2016-06-03T18:13:35Z","html_url":"https://github.com/falconry/falcon/pull/812#discussion_r65752218","pull_request_url":"https://api.github.com/repos/falconry/falcon/pulls/812","_links":{"self":{"href":"https://api.github.com/repos/falconry/falcon/pulls/comments/65752218"},"html":{"href":"https://github.com/falconry/falcon/pull/812#discussion_r65752218"},"pull_request":{"href":"https://api.github.com/repos/falconry/falcon/pulls/812"}}},"pull_request":{"url":"https://api.github.com/repos/falconry/falcon/pulls/812","id":72425357,"html_url":"https://github.com/falconry/falcon/pull/812","diff_url":"https://github.com/falconry/falcon/pull/812.diff","patch_url":"https://github.com/falconry/falcon/pull/812.patch","issue_url":"https://api.github.com/repos/falconry/falcon/issues/812","number":812,"state":"open","locked":false,"title":"Issue #744 - added a utility function for looking up status messages","user":{"login":"molund","id":547803,"avatar_url":"https://avatars.githubusercontent.com/u/547803?v=3","gravatar_id":"","url":"https://api.github.com/users/molund","html_url":"https://github.com/molund","followers_url":"https://api.github.com/users/molund/followers","following_url":"https://api.github.com/users/molund/following{/other_user}","gists_url":"https://api.github.com/users/molund/gists{/gist_id}","starred_url":"https://api.github.com/users/molund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molund/subscriptions","organizations_url":"https://api.github.com/users/molund/orgs","repos_url":"https://api.github.com/users/molund/repos","events_url":"https://api.github.com/users/molund/events{/privacy}","received_events_url":"https://api.github.com/users/molund/received_events","type":"User","site_admin":false},"body":"Added a utility function for looking up status messages by status code.\r\n\r\nAdditional work is still required to add either one or two new attributes to the response object.  There should be 3 altogether for consistency with the python requests library and the JavaScript XmlHttpRequest:\r\n\r\nstatus  (e.g.  \"404 Not Found\")  <= already exists\r\nstatus_code  (e.g. 404)  <= NEW (read / write)\r\nreason  (e.g. \"Not Found\")  <= NEW  (read only)\r\n\r\n\r\n\r\n","created_at":"2016-06-02T22:05:09Z","updated_at":"2016-06-03T18:13:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2af167829fe06f4752996bf63d1e7493387c01c5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/falconry/falcon/pulls/812/commits","review_comments_url":"https://api.github.com/repos/falconry/falcon/pulls/812/comments","review_comment_url":"https://api.github.com/repos/falconry/falcon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/falconry/falcon/issues/812/comments","statuses_url":"https://api.github.com/repos/falconry/falcon/statuses/53acd9380f9ce0624d7d7f73e31a3581151898c4","head":{"label":"molund:master","ref":"master","sha":"53acd9380f9ce0624d7d7f73e31a3581151898c4","user":{"login":"molund","id":547803,"avatar_url":"https://avatars.githubusercontent.com/u/547803?v=3","gravatar_id":"","url":"https://api.github.com/users/molund","html_url":"https://github.com/molund","followers_url":"https://api.github.com/users/molund/followers","following_url":"https://api.github.com/users/molund/following{/other_user}","gists_url":"https://api.github.com/users/molund/gists{/gist_id}","starred_url":"https://api.github.com/users/molund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molund/subscriptions","organizations_url":"https://api.github.com/users/molund/orgs","repos_url":"https://api.github.com/users/molund/repos","events_url":"https://api.github.com/users/molund/events{/privacy}","received_events_url":"https://api.github.com/users/molund/received_events","type":"User","site_admin":false},"repo":{"id":60299974,"name":"falcon","full_name":"molund/falcon","owner":{"login":"molund","id":547803,"avatar_url":"https://avatars.githubusercontent.com/u/547803?v=3","gravatar_id":"","url":"https://api.github.com/users/molund","html_url":"https://github.com/molund","followers_url":"https://api.github.com/users/molund/followers","following_url":"https://api.github.com/users/molund/following{/other_user}","gists_url":"https://api.github.com/users/molund/gists{/gist_id}","starred_url":"https://api.github.com/users/molund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molund/subscriptions","organizations_url":"https://api.github.com/users/molund/orgs","repos_url":"https://api.github.com/users/molund/repos","events_url":"https://api.github.com/users/molund/events{/privacy}","received_events_url":"https://api.github.com/users/molund/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/molund/falcon","description":"Falcon is a low-level, high-performance Python framework for building HTTP APIs, app backends, and higher-level frameworks.","fork":true,"url":"https://api.github.com/repos/molund/falcon","forks_url":"https://api.github.com/repos/molund/falcon/forks","keys_url":"https://api.github.com/repos/molund/falcon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/molund/falcon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/molund/falcon/teams","hooks_url":"https://api.github.com/repos/molund/falcon/hooks","issue_events_url":"https://api.github.com/repos/molund/falcon/issues/events{/number}","events_url":"https://api.github.com/repos/molund/falcon/events","assignees_url":"https://api.github.com/repos/molund/falcon/assignees{/user}","branches_url":"https://api.github.com/repos/molund/falcon/branches{/branch}","tags_url":"https://api.github.com/repos/molund/falcon/tags","blobs_url":"https://api.github.com/repos/molund/falcon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/molund/falcon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/molund/falcon/git/refs{/sha}","trees_url":"https://api.github.com/repos/molund/falcon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/molund/falcon/statuses/{sha}","languages_url":"https://api.github.com/repos/molund/falcon/languages","stargazers_url":"https://api.github.com/repos/molund/falcon/stargazers","contributors_url":"https://api.github.com/repos/molund/falcon/contributors","subscribers_url":"https://api.github.com/repos/molund/falcon/subscribers","subscription_url":"https://api.github.com/repos/molund/falcon/subscription","commits_url":"https://api.github.com/repos/molund/falcon/commits{/sha}","git_commits_url":"https://api.github.com/repos/molund/falcon/git/commits{/sha}","comments_url":"https://api.github.com/repos/molund/falcon/comments{/number}","issue_comment_url":"https://api.github.com/repos/molund/falcon/issues/comments{/number}","contents_url":"https://api.github.com/repos/molund/falcon/contents/{+path}","compare_url":"https://api.github.com/repos/molund/falcon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/molund/falcon/merges","archive_url":"https://api.github.com/repos/molund/falcon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/molund/falcon/downloads","issues_url":"https://api.github.com/repos/molund/falcon/issues{/number}","pulls_url":"https://api.github.com/repos/molund/falcon/pulls{/number}","milestones_url":"https://api.github.com/repos/molund/falcon/milestones{/number}","notifications_url":"https://api.github.com/repos/molund/falcon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/molund/falcon/labels{/name}","releases_url":"https://api.github.com/repos/molund/falcon/releases{/id}","deployments_url":"https://api.github.com/repos/molund/falcon/deployments","created_at":"2016-06-02T21:55:42Z","updated_at":"2016-06-02T21:55:43Z","pushed_at":"2016-06-03T17:36:32Z","git_url":"git://github.com/molund/falcon.git","ssh_url":"git@github.com:molund/falcon.git","clone_url":"https://github.com/molund/falcon.git","svn_url":"https://github.com/molund/falcon","homepage":"https://falcon.readthedocs.org/en/stable/","size":26130,"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":"falconry:master","ref":"master","sha":"4d26f428be7a0eadbc456a0cd4cf79ffeac50d7a","user":{"login":"falconry","id":11353642,"avatar_url":"https://avatars.githubusercontent.com/u/11353642?v=3","gravatar_id":"","url":"https://api.github.com/users/falconry","html_url":"https://github.com/falconry","followers_url":"https://api.github.com/users/falconry/followers","following_url":"https://api.github.com/users/falconry/following{/other_user}","gists_url":"https://api.github.com/users/falconry/gists{/gist_id}","starred_url":"https://api.github.com/users/falconry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/falconry/subscriptions","organizations_url":"https://api.github.com/users/falconry/orgs","repos_url":"https://api.github.com/users/falconry/repos","events_url":"https://api.github.com/users/falconry/events{/privacy}","received_events_url":"https://api.github.com/users/falconry/received_events","type":"Organization","site_admin":false},"repo":{"id":7040500,"name":"falcon","full_name":"falconry/falcon","owner":{"login":"falconry","id":11353642,"avatar_url":"https://avatars.githubusercontent.com/u/11353642?v=3","gravatar_id":"","url":"https://api.github.com/users/falconry","html_url":"https://github.com/falconry","followers_url":"https://api.github.com/users/falconry/followers","following_url":"https://api.github.com/users/falconry/following{/other_user}","gists_url":"https://api.github.com/users/falconry/gists{/gist_id}","starred_url":"https://api.github.com/users/falconry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/falconry/subscriptions","organizations_url":"https://api.github.com/users/falconry/orgs","repos_url":"https://api.github.com/users/falconry/repos","events_url":"https://api.github.com/users/falconry/events{/privacy}","received_events_url":"https://api.github.com/users/falconry/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/falconry/falcon","description":"Falcon is a low-level, high-performance Python framework for building HTTP APIs, app backends, and higher-level frameworks.","fork":false,"url":"https://api.github.com/repos/falconry/falcon","forks_url":"https://api.github.com/repos/falconry/falcon/forks","keys_url":"https://api.github.com/repos/falconry/falcon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/falconry/falcon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/falconry/falcon/teams","hooks_url":"https://api.github.com/repos/falconry/falcon/hooks","issue_events_url":"https://api.github.com/repos/falconry/falcon/issues/events{/number}","events_url":"https://api.github.com/repos/falconry/falcon/events","assignees_url":"https://api.github.com/repos/falconry/falcon/assignees{/user}","branches_url":"https://api.github.com/repos/falconry/falcon/branches{/branch}","tags_url":"https://api.github.com/repos/falconry/falcon/tags","blobs_url":"https://api.github.com/repos/falconry/falcon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/falconry/falcon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/falconry/falcon/git/refs{/sha}","trees_url":"https://api.github.com/repos/falconry/falcon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/falconry/falcon/statuses/{sha}","languages_url":"https://api.github.com/repos/falconry/falcon/languages","stargazers_url":"https://api.github.com/repos/falconry/falcon/stargazers","contributors_url":"https://api.github.com/repos/falconry/falcon/contributors","subscribers_url":"https://api.github.com/repos/falconry/falcon/subscribers","subscription_url":"https://api.github.com/repos/falconry/falcon/subscription","commits_url":"https://api.github.com/repos/falconry/falcon/commits{/sha}","git_commits_url":"https://api.github.com/repos/falconry/falcon/git/commits{/sha}","comments_url":"https://api.github.com/repos/falconry/falcon/comments{/number}","issue_comment_url":"https://api.github.com/repos/falconry/falcon/issues/comments{/number}","contents_url":"https://api.github.com/repos/falconry/falcon/contents/{+path}","compare_url":"https://api.github.com/repos/falconry/falcon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/falconry/falcon/merges","archive_url":"https://api.github.com/repos/falconry/falcon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/falconry/falcon/downloads","issues_url":"https://api.github.com/repos/falconry/falcon/issues{/number}","pulls_url":"https://api.github.com/repos/falconry/falcon/pulls{/number}","milestones_url":"https://api.github.com/repos/falconry/falcon/milestones{/number}","notifications_url":"https://api.github.com/repos/falconry/falcon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/falconry/falcon/labels{/name}","releases_url":"https://api.github.com/repos/falconry/falcon/releases{/id}","deployments_url":"https://api.github.com/repos/falconry/falcon/deployments","created_at":"2012-12-06T18:17:51Z","updated_at":"2016-06-03T14:09:42Z","pushed_at":"2016-06-03T17:36:32Z","git_url":"git://github.com/falconry/falcon.git","ssh_url":"git@github.com:falconry/falcon.git","clone_url":"https://github.com/falconry/falcon.git","svn_url":"https://github.com/falconry/falcon","homepage":"https://falcon.readthedocs.org/en/stable/","size":26968,"stargazers_count":2923,"watchers_count":2923,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":337,"mirror_url":null,"open_issues_count":157,"forks":337,"open_issues":157,"watchers":2923,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/falconry/falcon/pulls/812"},"html":{"href":"https://github.com/falconry/falcon/pull/812"},"issue":{"href":"https://api.github.com/repos/falconry/falcon/issues/812"},"comments":{"href":"https://api.github.com/repos/falconry/falcon/issues/812/comments"},"review_comments":{"href":"https://api.github.com/repos/falconry/falcon/pulls/812/comments"},"review_comment":{"href":"https://api.github.com/repos/falconry/falcon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/falconry/falcon/pulls/812/commits"},"statuses":{"href":"https://api.github.com/repos/falconry/falcon/statuses/53acd9380f9ce0624d7d7f73e31a3581151898c4"}}}}
{"actor":{"display_login":"kgriffs"}}