{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift/pulls/comments/49000830","id":49000830,"diff_hunk":"@@ -53,7 +53,9 @@ def darwin_sdk_build_version_split(version):\n \n \n def darwin_sdk_build_version_cmp(lhs, rhs):\n-    return cmp(\n+    def _cmp(a, b):","path":"test/lit.cfg","position":5,"original_position":5,"commit_id":"389d9e581bd480fb0444633682a7baf985a02df8","original_commit_id":"389d9e581bd480fb0444633682a7baf985a02df8","user":{"login":"RLovelett","id":335572,"avatar_url":"https://avatars.githubusercontent.com/u/335572?v=3","gravatar_id":"","url":"https://api.github.com/users/RLovelett","html_url":"https://github.com/RLovelett","followers_url":"https://api.github.com/users/RLovelett/followers","following_url":"https://api.github.com/users/RLovelett/following{/other_user}","gists_url":"https://api.github.com/users/RLovelett/gists{/gist_id}","starred_url":"https://api.github.com/users/RLovelett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RLovelett/subscriptions","organizations_url":"https://api.github.com/users/RLovelett/orgs","repos_url":"https://api.github.com/users/RLovelett/repos","events_url":"https://api.github.com/users/RLovelett/events{/privacy}","received_events_url":"https://api.github.com/users/RLovelett/received_events","type":"User","site_admin":false},"body":"I did put a description and a link in the commit message itself, not just the MR description, so that the message would always show up in the `git blame` of that line. (You can see it if you do a `git show 389d9e581bd480fb0444633682a7baf985a02df8`)\r\n\r\nI'll see what I can do to condense that and transfer it to a code comment. Thank you for the review.","created_at":"2016-01-06T19:49:13Z","updated_at":"2016-01-06T19:49:13Z","html_url":"https://github.com/apple/swift/pull/830#discussion_r49000830","pull_request_url":"https://api.github.com/repos/apple/swift/pulls/830","_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/comments/49000830"},"html":{"href":"https://github.com/apple/swift/pull/830#discussion_r49000830"},"pull_request":{"href":"https://api.github.com/repos/apple/swift/pulls/830"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/830","id":54879439,"html_url":"https://github.com/apple/swift/pull/830","diff_url":"https://github.com/apple/swift/pull/830.diff","patch_url":"https://github.com/apple/swift/pull/830.patch","issue_url":"https://api.github.com/repos/apple/swift/issues/830","number":830,"state":"open","locked":false,"title":"[lit] The cmp() function should be treated as gone in Python 3","user":{"login":"RLovelett","id":335572,"avatar_url":"https://avatars.githubusercontent.com/u/335572?v=3","gravatar_id":"","url":"https://api.github.com/users/RLovelett","html_url":"https://github.com/RLovelett","followers_url":"https://api.github.com/users/RLovelett/followers","following_url":"https://api.github.com/users/RLovelett/following{/other_user}","gists_url":"https://api.github.com/users/RLovelett/gists{/gist_id}","starred_url":"https://api.github.com/users/RLovelett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RLovelett/subscriptions","organizations_url":"https://api.github.com/users/RLovelett/orgs","repos_url":"https://api.github.com/users/RLovelett/repos","events_url":"https://api.github.com/users/RLovelett/events{/privacy}","received_events_url":"https://api.github.com/users/RLovelett/received_events","type":"User","site_admin":false},"body":"As noted in the [\"What's New in Python 3.0\"](https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons) documentation the Python 2 `cmp` function no longer exists in Python 3. The document goes on to say that if you really need the `cmp` function you should define your own.\r\n\r\nSince the function appears to only be used once in the script I defined a local function rather than shadow the Python 2 function. The local function, `_cmp`, implements the recommended expression from the [\"What's New in Python 3.0\"](https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons) document. The behavior is now defined on both Python 2 and 3.","created_at":"2015-12-31T20:33:01Z","updated_at":"2016-01-06T19:49:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bbb8ddb1ff2a0c643a4aef8c999d7d030d928c7c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift/pulls/830/commits","review_comments_url":"https://api.github.com/repos/apple/swift/pulls/830/comments","review_comment_url":"https://api.github.com/repos/apple/swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift/issues/830/comments","statuses_url":"https://api.github.com/repos/apple/swift/statuses/389d9e581bd480fb0444633682a7baf985a02df8","head":{"label":"RLovelett:lit-python-3","ref":"lit-python-3","sha":"389d9e581bd480fb0444633682a7baf985a02df8","user":{"login":"RLovelett","id":335572,"avatar_url":"https://avatars.githubusercontent.com/u/335572?v=3","gravatar_id":"","url":"https://api.github.com/users/RLovelett","html_url":"https://github.com/RLovelett","followers_url":"https://api.github.com/users/RLovelett/followers","following_url":"https://api.github.com/users/RLovelett/following{/other_user}","gists_url":"https://api.github.com/users/RLovelett/gists{/gist_id}","starred_url":"https://api.github.com/users/RLovelett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RLovelett/subscriptions","organizations_url":"https://api.github.com/users/RLovelett/orgs","repos_url":"https://api.github.com/users/RLovelett/repos","events_url":"https://api.github.com/users/RLovelett/events{/privacy}","received_events_url":"https://api.github.com/users/RLovelett/received_events","type":"User","site_admin":false},"repo":{"id":47842086,"name":"swift","full_name":"RLovelett/swift","owner":{"login":"RLovelett","id":335572,"avatar_url":"https://avatars.githubusercontent.com/u/335572?v=3","gravatar_id":"","url":"https://api.github.com/users/RLovelett","html_url":"https://github.com/RLovelett","followers_url":"https://api.github.com/users/RLovelett/followers","following_url":"https://api.github.com/users/RLovelett/following{/other_user}","gists_url":"https://api.github.com/users/RLovelett/gists{/gist_id}","starred_url":"https://api.github.com/users/RLovelett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RLovelett/subscriptions","organizations_url":"https://api.github.com/users/RLovelett/orgs","repos_url":"https://api.github.com/users/RLovelett/repos","events_url":"https://api.github.com/users/RLovelett/events{/privacy}","received_events_url":"https://api.github.com/users/RLovelett/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RLovelett/swift","description":"The Swift Programming Language","fork":true,"url":"https://api.github.com/repos/RLovelett/swift","forks_url":"https://api.github.com/repos/RLovelett/swift/forks","keys_url":"https://api.github.com/repos/RLovelett/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RLovelett/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RLovelett/swift/teams","hooks_url":"https://api.github.com/repos/RLovelett/swift/hooks","issue_events_url":"https://api.github.com/repos/RLovelett/swift/issues/events{/number}","events_url":"https://api.github.com/repos/RLovelett/swift/events","assignees_url":"https://api.github.com/repos/RLovelett/swift/assignees{/user}","branches_url":"https://api.github.com/repos/RLovelett/swift/branches{/branch}","tags_url":"https://api.github.com/repos/RLovelett/swift/tags","blobs_url":"https://api.github.com/repos/RLovelett/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RLovelett/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RLovelett/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/RLovelett/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RLovelett/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/RLovelett/swift/languages","stargazers_url":"https://api.github.com/repos/RLovelett/swift/stargazers","contributors_url":"https://api.github.com/repos/RLovelett/swift/contributors","subscribers_url":"https://api.github.com/repos/RLovelett/swift/subscribers","subscription_url":"https://api.github.com/repos/RLovelett/swift/subscription","commits_url":"https://api.github.com/repos/RLovelett/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/RLovelett/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/RLovelett/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/RLovelett/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/RLovelett/swift/contents/{+path}","compare_url":"https://api.github.com/repos/RLovelett/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RLovelett/swift/merges","archive_url":"https://api.github.com/repos/RLovelett/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RLovelett/swift/downloads","issues_url":"https://api.github.com/repos/RLovelett/swift/issues{/number}","pulls_url":"https://api.github.com/repos/RLovelett/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/RLovelett/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/RLovelett/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RLovelett/swift/labels{/name}","releases_url":"https://api.github.com/repos/RLovelett/swift/releases{/id}","created_at":"2015-12-11T17:50:41Z","updated_at":"2015-12-11T17:50:56Z","pushed_at":"2016-01-06T14:41:38Z","git_url":"git://github.com/RLovelett/swift.git","ssh_url":"git@github.com:RLovelett/swift.git","clone_url":"https://github.com/RLovelett/swift.git","svn_url":"https://github.com/RLovelett/swift","homepage":"https://swift.org/","size":66704,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apple:master","ref":"master","sha":"09b6afc19a3ce342a7dc7baa06c4b9fd0296651f","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838949,"name":"swift","full_name":"apple/swift","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","created_at":"2015-10-23T21:15:07Z","updated_at":"2016-01-06T19:28:27Z","pushed_at":"2016-01-06T19:40:33Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"https://swift.org/","size":86017,"stargazers_count":25189,"watchers_count":25189,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3117,"mirror_url":null,"open_issues_count":60,"forks":3117,"open_issues":60,"watchers":25189,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/830"},"html":{"href":"https://github.com/apple/swift/pull/830"},"issue":{"href":"https://api.github.com/repos/apple/swift/issues/830"},"comments":{"href":"https://api.github.com/repos/apple/swift/issues/830/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift/pulls/830/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift/pulls/830/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift/statuses/389d9e581bd480fb0444633682a7baf985a02df8"}}}}