A type slot for tp_as_async has already been added (which is good!) but we do not currently seem to have protocol functions for awaitable types.
I would expect to find an Awaitable Protocol listed under Abstract Objects Layer, with functions like PyAwait_Check, PyAwaitIter_Check, and PyAwaitIter_Next, etc. Specifically its currently difficult to test whether an object is awaitable or an awaitable iterable, or use said objects from the c-api without relying on method testing/calling mechanisms.
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com