{"action":"created","comment":{"url":"https://api.github.com/repos/python/cpython/pulls/comments/206235828","pull_request_review_id":141611588,"id":206235828,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjIzNTgyOA==","diff_hunk":"@@ -23,6 +24,9 @@\n from . import futures\n from .coroutines import coroutine\n \n+# Helper to generate new task names\n+_counter = itertools.count(1).__next__","path":"Lib/asyncio/tasks.py","position":11,"original_position":11,"commit_id":"19204e1e3f4a55a1456805fd79e8c9d9f8fabc77","original_commit_id":"19204e1e3f4a55a1456805fd79e8c9d9f8fabc77","user":{"login":"agronholm","id":130003,"node_id":"MDQ6VXNlcjEzMDAwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/130003?v=4","gravatar_id":"","url":"https://api.github.com/users/agronholm","html_url":"https://github.com/agronholm","followers_url":"https://api.github.com/users/agronholm/followers","following_url":"https://api.github.com/users/agronholm/following{/other_user}","gists_url":"https://api.github.com/users/agronholm/gists{/gist_id}","starred_url":"https://api.github.com/users/agronholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agronholm/subscriptions","organizations_url":"https://api.github.com/users/agronholm/orgs","repos_url":"https://api.github.com/users/agronholm/repos","events_url":"https://api.github.com/users/agronholm/events{/privacy}","received_events_url":"https://api.github.com/users/agronholm/received_events","type":"User","site_admin":false},"body":"This is what the threading module does, and it uses `itertools.count()` because `_counter += 1` is not thread safe. The same applies to asyncio if there are more than one thread running an event loop (since the counter is global).","created_at":"2018-07-30T16:22:26Z","updated_at":"2018-07-30T16:22:26Z","html_url":"https://github.com/python/cpython/pull/8547#discussion_r206235828","pull_request_url":"https://api.github.com/repos/python/cpython/pulls/8547","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/python/cpython/pulls/comments/206235828"},"html":{"href":"https://github.com/python/cpython/pull/8547#discussion_r206235828"},"pull_request":{"href":"https://api.github.com/repos/python/cpython/pulls/8547"}},"in_reply_to_id":206153899},"pull_request":{"url":"https://api.github.com/repos/python/cpython/pulls/8547","id":204638108,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NjM4MTA4","html_url":"https://github.com/python/cpython/pull/8547","diff_url":"https://github.com/python/cpython/pull/8547.diff","patch_url":"https://github.com/python/cpython/pull/8547.patch","issue_url":"https://api.github.com/repos/python/cpython/issues/8547","number":8547,"state":"open","locked":false,"title":"bpo-34270: added the \"name\" attribute to asyncio tasks","user":{"login":"agronholm","id":130003,"node_id":"MDQ6VXNlcjEzMDAwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/130003?v=4","gravatar_id":"","url":"https://api.github.com/users/agronholm","html_url":"https://github.com/agronholm","followers_url":"https://api.github.com/users/agronholm/followers","following_url":"https://api.github.com/users/agronholm/following{/other_user}","gists_url":"https://api.github.com/users/agronholm/gists{/gist_id}","starred_url":"https://api.github.com/users/agronholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agronholm/subscriptions","organizations_url":"https://api.github.com/users/agronholm/orgs","repos_url":"https://api.github.com/users/agronholm/repos","events_url":"https://api.github.com/users/agronholm/events{/privacy}","received_events_url":"https://api.github.com/users/agronholm/received_events","type":"User","site_admin":false},"body":"The ability to name individual tasks helps developers debug complex\r\nasyncio applications.\r\n\r\nCo-authored-by: Antti Haapala <antti.haapala@anttipatterns.com>\r\n\r\n<!--\r\nThanks for your contribution!\r\nPlease read this comment in its entirety. It's quite important.\r\n\r\n# Pull Request title\r\n\r\nIt should be in the following format:\r\n\r\n```\r\nbpo-NNNN: Summary of the changes made\r\n```\r\n\r\nWhere: bpo-NNNN refers to the issue number in the https://bugs.python.org.\r\n\r\nMost PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue.\r\n\r\n# Backport Pull Request title\r\n\r\nIf this is a backport PR (PR made against branches other than `master`),\r\nplease ensure that the PR title is in the following format:\r\n\r\n```\r\n[X.Y] <title from the original PR> (GH-NNNN)\r\n```\r\n\r\nWhere: [X.Y] is the branch name, e.g. [3.6].\r\n\r\nGH-NNNN refers to the PR number from `master`.\r\n\r\n-->\r\n\n\n<!-- issue-number: [bpo-34270](https://www.bugs.python.org/issue34270) -->\nhttps://bugs.python.org/issue34270\n<!-- /issue-number -->\n","created_at":"2018-07-29T11:41:28Z","updated_at":"2018-07-30T16:22:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07816d609508f1a96610f597168f14fa910ab371","assignee":null,"assignees":[],"requested_reviewers":[{"login":"asvetlov","id":356399,"node_id":"MDQ6VXNlcjM1NjM5OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/356399?v=4","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":536945571,"node_id":"MDU6TGFiZWw1MzY5NDU1NzE=","url":"https://api.github.com/repos/python/cpython/labels/CLA%20not%20signed","name":"CLA not signed","color":"b60205","default":false},{"id":666979922,"node_id":"MDU6TGFiZWw2NjY5Nzk5MjI=","url":"https://api.github.com/repos/python/cpython/labels/awaiting%20changes","name":"awaiting changes","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/python/cpython/pulls/8547/commits","review_comments_url":"https://api.github.com/repos/python/cpython/pulls/8547/comments","review_comment_url":"https://api.github.com/repos/python/cpython/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python/cpython/issues/8547/comments","statuses_url":"https://api.github.com/repos/python/cpython/statuses/19204e1e3f4a55a1456805fd79e8c9d9f8fabc77","head":{"label":"agronholm:tasknames","ref":"tasknames","sha":"19204e1e3f4a55a1456805fd79e8c9d9f8fabc77","user":{"login":"agronholm","id":130003,"node_id":"MDQ6VXNlcjEzMDAwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/130003?v=4","gravatar_id":"","url":"https://api.github.com/users/agronholm","html_url":"https://github.com/agronholm","followers_url":"https://api.github.com/users/agronholm/followers","following_url":"https://api.github.com/users/agronholm/following{/other_user}","gists_url":"https://api.github.com/users/agronholm/gists{/gist_id}","starred_url":"https://api.github.com/users/agronholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agronholm/subscriptions","organizations_url":"https://api.github.com/users/agronholm/orgs","repos_url":"https://api.github.com/users/agronholm/repos","events_url":"https://api.github.com/users/agronholm/events{/privacy}","received_events_url":"https://api.github.com/users/agronholm/received_events","type":"User","site_admin":false},"repo":{"id":142754494,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI3NTQ0OTQ=","name":"cpython","full_name":"agronholm/cpython","owner":{"login":"agronholm","id":130003,"node_id":"MDQ6VXNlcjEzMDAwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/130003?v=4","gravatar_id":"","url":"https://api.github.com/users/agronholm","html_url":"https://github.com/agronholm","followers_url":"https://api.github.com/users/agronholm/followers","following_url":"https://api.github.com/users/agronholm/following{/other_user}","gists_url":"https://api.github.com/users/agronholm/gists{/gist_id}","starred_url":"https://api.github.com/users/agronholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agronholm/subscriptions","organizations_url":"https://api.github.com/users/agronholm/orgs","repos_url":"https://api.github.com/users/agronholm/repos","events_url":"https://api.github.com/users/agronholm/events{/privacy}","received_events_url":"https://api.github.com/users/agronholm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/agronholm/cpython","description":"The Python programming language","fork":true,"url":"https://api.github.com/repos/agronholm/cpython","forks_url":"https://api.github.com/repos/agronholm/cpython/forks","keys_url":"https://api.github.com/repos/agronholm/cpython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agronholm/cpython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agronholm/cpython/teams","hooks_url":"https://api.github.com/repos/agronholm/cpython/hooks","issue_events_url":"https://api.github.com/repos/agronholm/cpython/issues/events{/number}","events_url":"https://api.github.com/repos/agronholm/cpython/events","assignees_url":"https://api.github.com/repos/agronholm/cpython/assignees{/user}","branches_url":"https://api.github.com/repos/agronholm/cpython/branches{/branch}","tags_url":"https://api.github.com/repos/agronholm/cpython/tags","blobs_url":"https://api.github.com/repos/agronholm/cpython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agronholm/cpython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agronholm/cpython/git/refs{/sha}","trees_url":"https://api.github.com/repos/agronholm/cpython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agronholm/cpython/statuses/{sha}","languages_url":"https://api.github.com/repos/agronholm/cpython/languages","stargazers_url":"https://api.github.com/repos/agronholm/cpython/stargazers","contributors_url":"https://api.github.com/repos/agronholm/cpython/contributors","subscribers_url":"https://api.github.com/repos/agronholm/cpython/subscribers","subscription_url":"https://api.github.com/repos/agronholm/cpython/subscription","commits_url":"https://api.github.com/repos/agronholm/cpython/commits{/sha}","git_commits_url":"https://api.github.com/repos/agronholm/cpython/git/commits{/sha}","comments_url":"https://api.github.com/repos/agronholm/cpython/comments{/number}","issue_comment_url":"https://api.github.com/repos/agronholm/cpython/issues/comments{/number}","contents_url":"https://api.github.com/repos/agronholm/cpython/contents/{+path}","compare_url":"https://api.github.com/repos/agronholm/cpython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agronholm/cpython/merges","archive_url":"https://api.github.com/repos/agronholm/cpython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agronholm/cpython/downloads","issues_url":"https://api.github.com/repos/agronholm/cpython/issues{/number}","pulls_url":"https://api.github.com/repos/agronholm/cpython/pulls{/number}","milestones_url":"https://api.github.com/repos/agronholm/cpython/milestones{/number}","notifications_url":"https://api.github.com/repos/agronholm/cpython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agronholm/cpython/labels{/name}","releases_url":"https://api.github.com/repos/agronholm/cpython/releases{/id}","deployments_url":"https://api.github.com/repos/agronholm/cpython/deployments","created_at":"2018-07-29T11:17:28Z","updated_at":"2018-07-29T11:17:52Z","pushed_at":"2018-07-29T11:39:59Z","git_url":"git://github.com/agronholm/cpython.git","ssh_url":"git@github.com:agronholm/cpython.git","clone_url":"https://github.com/agronholm/cpython.git","svn_url":"https://github.com/agronholm/cpython","homepage":"https://www.python.org/","size":244550,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"python:master","ref":"master","sha":"b7fd73896db5666020e382c010b8da900260ede4","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-07-30T15:57:42Z","pushed_at":"2018-07-30T15:57:01Z","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":244566,"stargazers_count":18965,"watchers_count":18965,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6241,"mirror_url":null,"archived":false,"open_issues_count":830,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":6241,"open_issues":830,"watchers":18965,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python/cpython/pulls/8547"},"html":{"href":"https://github.com/python/cpython/pull/8547"},"issue":{"href":"https://api.github.com/repos/python/cpython/issues/8547"},"comments":{"href":"https://api.github.com/repos/python/cpython/issues/8547/comments"},"review_comments":{"href":"https://api.github.com/repos/python/cpython/pulls/8547/comments"},"review_comment":{"href":"https://api.github.com/repos/python/cpython/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python/cpython/pulls/8547/commits"},"statuses":{"href":"https://api.github.com/repos/python/cpython/statuses/19204e1e3f4a55a1456805fd79e8c9d9f8fabc77"}},"author_association":"NONE"}}
{"actor":{"display_login":"agronholm"}}