blob: a95fa141c7e56292541e3c295882b825a0f2adea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<span id="coro-objects"></span><h1>Coroutine Objects</h1> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.5.</span></p> </div> <p>Coroutine objects are what functions declared with an <code>async</code> keyword return.</p> <dl class="c type"> <dt class="sig sig-object c" id="c.PyCoroObject">
<code>type PyCoroObject</code> </dt> <dd>
<p>The C structure used for coroutine objects.</p> </dd>
</dl> <dl class="c var"> <dt class="sig sig-object c" id="c.PyCoro_Type">
<code>PyTypeObject PyCoro_Type</code> </dt> <dd>
<p>The type object corresponding to coroutine objects.</p> </dd>
</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyCoro_CheckExact">
<code>int PyCoro_CheckExact(PyObject *ob)</code> </dt> <dd>
<p>Return true if <em>ob</em>’s type is <a class="reference internal" href="#c.PyCoro_Type" title="PyCoro_Type"><code>PyCoro_Type</code></a>; <em>ob</em> must not be <code>NULL</code>. This function always succeeds.</p> </dd>
</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyCoro_New">
<code>PyObject *PyCoro_New(PyFrameObject *frame, PyObject *name, PyObject *qualname)</code> </dt> <dd>
<em class="refcount">Return value: New reference.</em><p>Create and return a new coroutine object based on the <em>frame</em> object, with <code>__name__</code> and <code>__qualname__</code> set to <em>name</em> and <em>qualname</em>. A reference to <em>frame</em> is stolen by this function. The <em>frame</em> argument must not be <code>NULL</code>.</p> </dd>
</dl> <div class="_attribution">
<p class="_attribution-p">
© 2001–2023 Python Software Foundation<br>Licensed under the PSF License.<br>
<a href="https://docs.python.org/3.12/c-api/coro.html" class="_attribution-link">https://docs.python.org/3.12/c-api/coro.html</a>
</p>
</div>
|