This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Make _PyCoro_GetAwaitableIter a public API
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.6
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: yselivanov Nosy List: gvanrossum,, ncoghlan, scoder, vstinner, yselivanov
Priority: normal Keywords:

Created on 2015-06-25 15:35 by yselivanov, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg245812 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-06-25 15:35
We should consider making _PyCoro_GetAwaitableIter(o) a public API.

Its implementation isn't trivial because it's not around simply accessing 'tp_as_async->am_await'.  You also need to check is 'o' is a generator with a CO_ITERABLE_COROUTINE or a CoroObject, etc.
msg245817 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-06-25 15:55
It looks like the code is currently moving fast. I suggest to wait until Python 3.6 to stabilize the Python C API for async/await.
msg245818 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-06-25 16:05
> It looks like the code is currently moving fast. [..]

Yeah, that's my feeling too, I don't want to rush things too much.  Unless Guido, Nick and you are in complete agreement that we need this, we should postpone till 3.6.
msg245837 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2015-06-26 07:40
+1 for deferring to 3.6 (version field adjusted accordingly)

One nice aspect of marking private APIs by convention rather than having them enforced by the compiler is that the folks that *really* need them can ignore our recommendation and accept the fact they may need to adapt their code to account for backwards incompatible changes.
msg276617 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2016-09-15 20:47
Closing this one as no one has requested this for 2 years.
Date User Action Args
2022-04-11 14:58:18adminsetgithub: 68698
2016-09-15 20:47:55yselivanovsetstatus: open -> closed
resolution: wont fix
messages: + msg276617

stage: resolved
2016-05-24 18:43:43mdcb808@gmail.comsetnosy: +
2015-06-26 07:40:39ncoghlansetmessages: + msg245837
versions: - Python 3.5
2015-06-25 16:05:54yselivanovsetmessages: + msg245818
2015-06-25 15:55:09vstinnersetmessages: + msg245817
2015-06-25 15:35:58yselivanovcreate