{"action":"created","comment":{"url":"https://api.github.com/repos/python/cpython/pulls/comments/206998390","pull_request_review_id":142521551,"id":206998390,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjk5ODM5MA==","diff_hunk":"@@ -361,6 +363,15 @@ def test__getitem__(self):\n             retval2 = fi[1]\n             self.assertEqual(retval2, \"line2\\n\")\n \n+    def test__getitem___deprecation(self):\n+        t = self.writeTmp(\"line1\\nline2\\n\")\n+        with self.assertWarnsRegex(DeprecationWarning,\n+                                   r'Use iterator protocol instead'):\n+            with FileInput(files=[t]) as fi:\n+                with self.assertRaises(RuntimeError):\n+                    fi[1]","path":"Lib/test/test_fileinput.py","position":26,"original_position":26,"commit_id":"3f623feb59678b7c8a33c6cce9c655dfddd167b0","original_commit_id":"3f623feb59678b7c8a33c6cce9c655dfddd167b0","user":{"login":"berkerpeksag","id":26338,"node_id":"MDQ6VXNlcjI2MzM4","avatar_url":"https://avatars1.githubusercontent.com/u/26338?v=4","gravatar_id":"","url":"https://api.github.com/users/berkerpeksag","html_url":"https://github.com/berkerpeksag","followers_url":"https://api.github.com/users/berkerpeksag/followers","following_url":"https://api.github.com/users/berkerpeksag/following{/other_user}","gists_url":"https://api.github.com/users/berkerpeksag/gists{/gist_id}","starred_url":"https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkerpeksag/subscriptions","organizations_url":"https://api.github.com/users/berkerpeksag/orgs","repos_url":"https://api.github.com/users/berkerpeksag/repos","events_url":"https://api.github.com/users/berkerpeksag/events{/privacy}","received_events_url":"https://api.github.com/users/berkerpeksag/received_events","type":"User","site_admin":false},"body":"I used `fi[1]` on purpose to show that `__getitem__` doesn't work as expected (e.g. it would return `'line2\\n'` if it does)","created_at":"2018-08-01T19:08:12Z","updated_at":"2018-08-01T19:08:12Z","html_url":"https://github.com/python/cpython/pull/8609#discussion_r206998390","pull_request_url":"https://api.github.com/repos/python/cpython/pulls/8609","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/python/cpython/pulls/comments/206998390"},"html":{"href":"https://github.com/python/cpython/pull/8609#discussion_r206998390"},"pull_request":{"href":"https://api.github.com/repos/python/cpython/pulls/8609"}},"in_reply_to_id":206994718},"pull_request":{"url":"https://api.github.com/repos/python/cpython/pulls/8609","id":205516588,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1NTE2NTg4","html_url":"https://github.com/python/cpython/pull/8609","diff_url":"https://github.com/python/cpython/pull/8609.diff","patch_url":"https://github.com/python/cpython/pull/8609.patch","issue_url":"https://api.github.com/repos/python/cpython/issues/8609","number":8609,"state":"open","locked":false,"title":"bpo-9372: Deprecate several __getitem__ methods","user":{"login":"berkerpeksag","id":26338,"node_id":"MDQ6VXNlcjI2MzM4","avatar_url":"https://avatars1.githubusercontent.com/u/26338?v=4","gravatar_id":"","url":"https://api.github.com/users/berkerpeksag","html_url":"https://github.com/berkerpeksag","followers_url":"https://api.github.com/users/berkerpeksag/followers","following_url":"https://api.github.com/users/berkerpeksag/following{/other_user}","gists_url":"https://api.github.com/users/berkerpeksag/gists{/gist_id}","starred_url":"https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkerpeksag/subscriptions","organizations_url":"https://api.github.com/users/berkerpeksag/orgs","repos_url":"https://api.github.com/users/berkerpeksag/repos","events_url":"https://api.github.com/users/berkerpeksag/events{/privacy}","received_events_url":"https://api.github.com/users/berkerpeksag/received_events","type":"User","site_admin":false},"body":"The __getitem__ methods of DOMEventStream, FileInput\r\nand FileWrapper classes ignore their 'index'\r\nparameters and return the next item instead.\n\n<!-- issue-number: [bpo-9372](https://www.bugs.python.org/issue9372) -->\nhttps://bugs.python.org/issue9372\n<!-- /issue-number -->\n","created_at":"2018-08-01T18:42:12Z","updated_at":"2018-08-01T19:08:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"576ac4026192c5325170ed0834f30cda5ca0de0f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":536945472,"node_id":"MDU6TGFiZWw1MzY5NDU0NzI=","url":"https://api.github.com/repos/python/cpython/labels/CLA%20signed","name":"CLA signed","color":"0e8a16","default":false},{"id":666980059,"node_id":"MDU6TGFiZWw2NjY5ODAwNTk=","url":"https://api.github.com/repos/python/cpython/labels/awaiting%20merge","name":"awaiting merge","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/python/cpython/pulls/8609/commits","review_comments_url":"https://api.github.com/repos/python/cpython/pulls/8609/comments","review_comment_url":"https://api.github.com/repos/python/cpython/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python/cpython/issues/8609/comments","statuses_url":"https://api.github.com/repos/python/cpython/statuses/3f623feb59678b7c8a33c6cce9c655dfddd167b0","head":{"label":"berkerpeksag:9372-getitem-deprecation","ref":"9372-getitem-deprecation","sha":"3f623feb59678b7c8a33c6cce9c655dfddd167b0","user":{"login":"berkerpeksag","id":26338,"node_id":"MDQ6VXNlcjI2MzM4","avatar_url":"https://avatars1.githubusercontent.com/u/26338?v=4","gravatar_id":"","url":"https://api.github.com/users/berkerpeksag","html_url":"https://github.com/berkerpeksag","followers_url":"https://api.github.com/users/berkerpeksag/followers","following_url":"https://api.github.com/users/berkerpeksag/following{/other_user}","gists_url":"https://api.github.com/users/berkerpeksag/gists{/gist_id}","starred_url":"https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkerpeksag/subscriptions","organizations_url":"https://api.github.com/users/berkerpeksag/orgs","repos_url":"https://api.github.com/users/berkerpeksag/repos","events_url":"https://api.github.com/users/berkerpeksag/events{/privacy}","received_events_url":"https://api.github.com/users/berkerpeksag/received_events","type":"User","site_admin":false},"repo":{"id":81646528,"node_id":"MDEwOlJlcG9zaXRvcnk4MTY0NjUyOA==","name":"cpython","full_name":"berkerpeksag/cpython","owner":{"login":"berkerpeksag","id":26338,"node_id":"MDQ6VXNlcjI2MzM4","avatar_url":"https://avatars1.githubusercontent.com/u/26338?v=4","gravatar_id":"","url":"https://api.github.com/users/berkerpeksag","html_url":"https://github.com/berkerpeksag","followers_url":"https://api.github.com/users/berkerpeksag/followers","following_url":"https://api.github.com/users/berkerpeksag/following{/other_user}","gists_url":"https://api.github.com/users/berkerpeksag/gists{/gist_id}","starred_url":"https://api.github.com/users/berkerpeksag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkerpeksag/subscriptions","organizations_url":"https://api.github.com/users/berkerpeksag/orgs","repos_url":"https://api.github.com/users/berkerpeksag/repos","events_url":"https://api.github.com/users/berkerpeksag/events{/privacy}","received_events_url":"https://api.github.com/users/berkerpeksag/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/berkerpeksag/cpython","description":"The Python programming language","fork":true,"url":"https://api.github.com/repos/berkerpeksag/cpython","forks_url":"https://api.github.com/repos/berkerpeksag/cpython/forks","keys_url":"https://api.github.com/repos/berkerpeksag/cpython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/berkerpeksag/cpython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/berkerpeksag/cpython/teams","hooks_url":"https://api.github.com/repos/berkerpeksag/cpython/hooks","issue_events_url":"https://api.github.com/repos/berkerpeksag/cpython/issues/events{/number}","events_url":"https://api.github.com/repos/berkerpeksag/cpython/events","assignees_url":"https://api.github.com/repos/berkerpeksag/cpython/assignees{/user}","branches_url":"https://api.github.com/repos/berkerpeksag/cpython/branches{/branch}","tags_url":"https://api.github.com/repos/berkerpeksag/cpython/tags","blobs_url":"https://api.github.com/repos/berkerpeksag/cpython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/berkerpeksag/cpython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/berkerpeksag/cpython/git/refs{/sha}","trees_url":"https://api.github.com/repos/berkerpeksag/cpython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/berkerpeksag/cpython/statuses/{sha}","languages_url":"https://api.github.com/repos/berkerpeksag/cpython/languages","stargazers_url":"https://api.github.com/repos/berkerpeksag/cpython/stargazers","contributors_url":"https://api.github.com/repos/berkerpeksag/cpython/contributors","subscribers_url":"https://api.github.com/repos/berkerpeksag/cpython/subscribers","subscription_url":"https://api.github.com/repos/berkerpeksag/cpython/subscription","commits_url":"https://api.github.com/repos/berkerpeksag/cpython/commits{/sha}","git_commits_url":"https://api.github.com/repos/berkerpeksag/cpython/git/commits{/sha}","comments_url":"https://api.github.com/repos/berkerpeksag/cpython/comments{/number}","issue_comment_url":"https://api.github.com/repos/berkerpeksag/cpython/issues/comments{/number}","contents_url":"https://api.github.com/repos/berkerpeksag/cpython/contents/{+path}","compare_url":"https://api.github.com/repos/berkerpeksag/cpython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/berkerpeksag/cpython/merges","archive_url":"https://api.github.com/repos/berkerpeksag/cpython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/berkerpeksag/cpython/downloads","issues_url":"https://api.github.com/repos/berkerpeksag/cpython/issues{/number}","pulls_url":"https://api.github.com/repos/berkerpeksag/cpython/pulls{/number}","milestones_url":"https://api.github.com/repos/berkerpeksag/cpython/milestones{/number}","notifications_url":"https://api.github.com/repos/berkerpeksag/cpython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/berkerpeksag/cpython/labels{/name}","releases_url":"https://api.github.com/repos/berkerpeksag/cpython/releases{/id}","deployments_url":"https://api.github.com/repos/berkerpeksag/cpython/deployments","created_at":"2017-02-11T10:42:14Z","updated_at":"2018-07-09T19:52:55Z","pushed_at":"2018-08-01T18:41:15Z","git_url":"git://github.com/berkerpeksag/cpython.git","ssh_url":"git@github.com:berkerpeksag/cpython.git","clone_url":"https://github.com/berkerpeksag/cpython.git","svn_url":"https://github.com/berkerpeksag/cpython","homepage":"https://www.python.org/","size":228844,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"python:master","ref":"master","sha":"80b762f010097ab8137782e5fbdc89c5c620ed4e","user":{"login":"python","id":1525981,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MjU5ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1525981?v=4","gravatar_id":"","url":"https://api.github.com/users/python","html_url":"https://github.com/python","followers_url":"https://api.github.com/users/python/followers","following_url":"https://api.github.com/users/python/following{/other_user}","gists_url":"https://api.github.com/users/python/gists{/gist_id}","starred_url":"https://api.github.com/users/python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python/subscriptions","organizations_url":"https://api.github.com/users/python/orgs","repos_url":"https://api.github.com/users/python/repos","events_url":"https://api.github.com/users/python/events{/privacy}","received_events_url":"https://api.github.com/users/python/received_events","type":"Organization","site_admin":false},"repo":{"id":81598961,"node_id":"MDEwOlJlcG9zaXRvcnk4MTU5ODk2MQ==","name":"cpython","full_name":"python/cpython","owner":{"login":"python","id":1525981,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MjU5ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1525981?v=4","gravatar_id":"","url":"https://api.github.com/users/python","html_url":"https://github.com/python","followers_url":"https://api.github.com/users/python/followers","following_url":"https://api.github.com/users/python/following{/other_user}","gists_url":"https://api.github.com/users/python/gists{/gist_id}","starred_url":"https://api.github.com/users/python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python/subscriptions","organizations_url":"https://api.github.com/users/python/orgs","repos_url":"https://api.github.com/users/python/repos","events_url":"https://api.github.com/users/python/events{/privacy}","received_events_url":"https://api.github.com/users/python/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/python/cpython","description":"The Python programming language","fork":false,"url":"https://api.github.com/repos/python/cpython","forks_url":"https://api.github.com/repos/python/cpython/forks","keys_url":"https://api.github.com/repos/python/cpython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python/cpython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python/cpython/teams","hooks_url":"https://api.github.com/repos/python/cpython/hooks","issue_events_url":"https://api.github.com/repos/python/cpython/issues/events{/number}","events_url":"https://api.github.com/repos/python/cpython/events","assignees_url":"https://api.github.com/repos/python/cpython/assignees{/user}","branches_url":"https://api.github.com/repos/python/cpython/branches{/branch}","tags_url":"https://api.github.com/repos/python/cpython/tags","blobs_url":"https://api.github.com/repos/python/cpython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python/cpython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python/cpython/git/refs{/sha}","trees_url":"https://api.github.com/repos/python/cpython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python/cpython/statuses/{sha}","languages_url":"https://api.github.com/repos/python/cpython/languages","stargazers_url":"https://api.github.com/repos/python/cpython/stargazers","contributors_url":"https://api.github.com/repos/python/cpython/contributors","subscribers_url":"https://api.github.com/repos/python/cpython/subscribers","subscription_url":"https://api.github.com/repos/python/cpython/subscription","commits_url":"https://api.github.com/repos/python/cpython/commits{/sha}","git_commits_url":"https://api.github.com/repos/python/cpython/git/commits{/sha}","comments_url":"https://api.github.com/repos/python/cpython/comments{/number}","issue_comment_url":"https://api.github.com/repos/python/cpython/issues/comments{/number}","contents_url":"https://api.github.com/repos/python/cpython/contents/{+path}","compare_url":"https://api.github.com/repos/python/cpython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python/cpython/merges","archive_url":"https://api.github.com/repos/python/cpython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python/cpython/downloads","issues_url":"https://api.github.com/repos/python/cpython/issues{/number}","pulls_url":"https://api.github.com/repos/python/cpython/pulls{/number}","milestones_url":"https://api.github.com/repos/python/cpython/milestones{/number}","notifications_url":"https://api.github.com/repos/python/cpython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python/cpython/labels{/name}","releases_url":"https://api.github.com/repos/python/cpython/releases{/id}","deployments_url":"https://api.github.com/repos/python/cpython/deployments","created_at":"2017-02-10T19:23:51Z","updated_at":"2018-08-01T18:48:12Z","pushed_at":"2018-08-01T18:42:13Z","git_url":"git://github.com/python/cpython.git","ssh_url":"git@github.com:python/cpython.git","clone_url":"https://github.com/python/cpython.git","svn_url":"https://github.com/python/cpython","homepage":"https://www.python.org/","size":244954,"stargazers_count":19001,"watchers_count":19001,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6266,"mirror_url":null,"archived":false,"open_issues_count":831,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":6266,"open_issues":831,"watchers":19001,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python/cpython/pulls/8609"},"html":{"href":"https://github.com/python/cpython/pull/8609"},"issue":{"href":"https://api.github.com/repos/python/cpython/issues/8609"},"comments":{"href":"https://api.github.com/repos/python/cpython/issues/8609/comments"},"review_comments":{"href":"https://api.github.com/repos/python/cpython/pulls/8609/comments"},"review_comment":{"href":"https://api.github.com/repos/python/cpython/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python/cpython/pulls/8609/commits"},"statuses":{"href":"https://api.github.com/repos/python/cpython/statuses/3f623feb59678b7c8a33c6cce9c655dfddd167b0"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"berkerpeksag"}}