{"action":"created","issue":{"url":"https://api.github.com/repos/python/asyncio/issues/477","repository_url":"https://api.github.com/repos/python/asyncio","labels_url":"https://api.github.com/repos/python/asyncio/issues/477/labels{/name}","comments_url":"https://api.github.com/repos/python/asyncio/issues/477/comments","events_url":"https://api.github.com/repos/python/asyncio/issues/477/events","html_url":"https://github.com/python/asyncio/issues/477","id":196454183,"number":477,"title":"Proposal: Rename ensure_future to create_task","user":{"login":"asvetlov","id":356399,"avatar_url":"https://avatars.githubusercontent.com/u/356399?v=3","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2016-12-19T16:16:58Z","updated_at":"2016-12-27T05:54:56Z","closed_at":null,"body":"During my training sessions I constantly forced to say: \r\n\r\n     `ensure_future()` is used for creating new task by 99% of use cases.\r\n     \r\n     The name is not obvious but please remember this quirk. \r\n\r\nMaybe function renaming (with keeping backward compatible alias) could smooth asyncio learning curve a bit?"},"comment":{"url":"https://api.github.com/repos/python/asyncio/issues/comments/269274059","html_url":"https://github.com/python/asyncio/issues/477#issuecomment-269274059","issue_url":"https://api.github.com/repos/python/asyncio/issues/477","id":269274059,"user":{"login":"gvanrossum","id":2894642,"avatar_url":"https://avatars.githubusercontent.com/u/2894642?v=3","gravatar_id":"","url":"https://api.github.com/users/gvanrossum","html_url":"https://github.com/gvanrossum","followers_url":"https://api.github.com/users/gvanrossum/followers","following_url":"https://api.github.com/users/gvanrossum/following{/other_user}","gists_url":"https://api.github.com/users/gvanrossum/gists{/gist_id}","starred_url":"https://api.github.com/users/gvanrossum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvanrossum/subscriptions","organizations_url":"https://api.github.com/users/gvanrossum/orgs","repos_url":"https://api.github.com/users/gvanrossum/repos","events_url":"https://api.github.com/users/gvanrossum/events{/privacy}","received_events_url":"https://api.github.com/users/gvanrossum/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T05:54:56Z","updated_at":"2016-12-27T05:54:56Z","body":"@achimnol I am fine with adding `asyncio.create_task()`. By the time we are ready to talk about it we should have no problem explain what a task is and what its life cycle looks like.\r\n\r\nBut any name that might suggest that the newly created task automatically starts running is actually dangerous, because it *doesn't* -- at least not until you `await` something. That's a big difference with `threading.Thread().start()`.\r\n\r\nI realize that `schedule()` would be a bit clearer than `start()`, but to the first-time reader it still sounds potentially misleading. I want the API description to naturally give the user the right mental model, and that mental model should be that only one task runs at any time, and tasks *allow* other tasks to run by using `await`. (Also, a coroutine is always running in the context of a task -- but a single task can be responsible for a whole *stack* of coroutines, chained via `await`. And how this actually works is mostly an advanced topic that you don't need to be aware of until much later.)"}}
{"actor":{"display_login":"gvanrossum"}}