call.html 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
  6. <meta property="og:title" content="Call Protocol" />
  7. <meta property="og:type" content="website" />
  8. <meta property="og:url" content="https://docs.python.org/3/c-api/call.html" />
  9. <meta property="og:site_name" content="Python documentation" />
  10. <meta property="og:description" content="CPython supports two different calling protocols: tp_call and vectorcall. The tp_call Protocol: Instances of classes that set tp_call are callable. The signature of the slot is: A call is made usin..." />
  11. <meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" />
  12. <meta property="og:image:alt" content="Python documentation" />
  13. <meta name="description" content="CPython supports two different calling protocols: tp_call and vectorcall. The tp_call Protocol: Instances of classes that set tp_call are callable. The signature of the slot is: A call is made usin..." />
  14. <meta property="og:image:width" content="200" />
  15. <meta property="og:image:height" content="200" />
  16. <meta name="theme-color" content="#3776ab" />
  17. <title>Call Protocol &#8212; Python 3.12.0 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
  18. <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
  19. <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?digest=b37c26da2f7529d09fe70b41c4b2133fe4931a90" />
  20. <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css" />
  21. <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
  22. <script src="../_static/jquery.js"></script>
  23. <script src="../_static/underscore.js"></script>
  24. <script src="../_static/doctools.js"></script>
  25. <script src="../_static/sidebar.js"></script>
  26. <link rel="search" type="application/opensearchdescription+xml"
  27. title="Search within Python 3.12.0 documentation"
  28. href="../_static/opensearch.xml"/>
  29. <link rel="author" title="About these documents" href="../about.html" />
  30. <link rel="index" title="Index" href="../genindex.html" />
  31. <link rel="search" title="Search" href="../search.html" />
  32. <link rel="copyright" title="Copyright" href="../copyright.html" />
  33. <link rel="next" title="Number Protocol" href="number.html" />
  34. <link rel="prev" title="Object Protocol" href="object.html" />
  35. <link rel="canonical" href="https://docs.python.org/3/c-api/call.html" />
  36. <style>
  37. @media only screen {
  38. table.full-width-table {
  39. width: 100%;
  40. }
  41. }
  42. </style>
  43. <link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
  44. <link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
  45. <script type="text/javascript" src="../_static/copybutton.js"></script>
  46. <script type="text/javascript" src="../_static/menu.js"></script>
  47. <script type="text/javascript" src="../_static/themetoggle.js"></script>
  48. </head>
  49. <body>
  50. <div class="mobile-nav">
  51. <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
  52. aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
  53. <nav class="nav-content" role="navigation">
  54. <label for="menuToggler" class="toggler__label">
  55. <span></span>
  56. </label>
  57. <span class="nav-items-wrapper">
  58. <a href="https://www.python.org/" class="nav-logo">
  59. <img src="../_static/py.svg" alt="Logo"/>
  60. </a>
  61. <span class="version_switcher_placeholder"></span>
  62. <form role="search" class="search" action="../search.html" method="get">
  63. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
  64. <path fill-rule="nonzero" fill="currentColor" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
  65. </svg>
  66. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  67. <input type="submit" value="Go"/>
  68. </form>
  69. </span>
  70. </nav>
  71. <div class="menu-wrapper">
  72. <nav class="menu" role="navigation" aria-label="main navigation">
  73. <div class="language_switcher_placeholder"></div>
  74. <label class="theme-selector-label">
  75. Theme
  76. <select class="theme-selector" oninput="activateTheme(this.value)">
  77. <option value="auto" selected>Auto</option>
  78. <option value="light">Light</option>
  79. <option value="dark">Dark</option>
  80. </select>
  81. </label>
  82. <div>
  83. <h3><a href="../contents.html">Table of Contents</a></h3>
  84. <ul>
  85. <li><a class="reference internal" href="#">Call Protocol</a><ul>
  86. <li><a class="reference internal" href="#the-tp-call-protocol">The <em>tp_call</em> Protocol</a></li>
  87. <li><a class="reference internal" href="#the-vectorcall-protocol">The Vectorcall Protocol</a><ul>
  88. <li><a class="reference internal" href="#recursion-control">Recursion Control</a></li>
  89. <li><a class="reference internal" href="#vectorcall-support-api">Vectorcall Support API</a></li>
  90. </ul>
  91. </li>
  92. <li><a class="reference internal" href="#object-calling-api">Object Calling API</a></li>
  93. <li><a class="reference internal" href="#call-support-api">Call Support API</a></li>
  94. </ul>
  95. </li>
  96. </ul>
  97. </div>
  98. <div>
  99. <h4>Previous topic</h4>
  100. <p class="topless"><a href="object.html"
  101. title="previous chapter">Object Protocol</a></p>
  102. </div>
  103. <div>
  104. <h4>Next topic</h4>
  105. <p class="topless"><a href="number.html"
  106. title="next chapter">Number Protocol</a></p>
  107. </div>
  108. <div role="note" aria-label="source link">
  109. <h3>This Page</h3>
  110. <ul class="this-page-menu">
  111. <li><a href="../bugs.html">Report a Bug</a></li>
  112. <li>
  113. <a href="https://github.com/python/cpython/blob/main/Doc/c-api/call.rst"
  114. rel="nofollow">Show Source
  115. </a>
  116. </li>
  117. </ul>
  118. </div>
  119. </nav>
  120. </div>
  121. </div>
  122. <div class="related" role="navigation" aria-label="related navigation">
  123. <h3>Navigation</h3>
  124. <ul>
  125. <li class="right" style="margin-right: 10px">
  126. <a href="../genindex.html" title="General Index"
  127. accesskey="I">index</a></li>
  128. <li class="right" >
  129. <a href="../py-modindex.html" title="Python Module Index"
  130. >modules</a> |</li>
  131. <li class="right" >
  132. <a href="number.html" title="Number Protocol"
  133. accesskey="N">next</a> |</li>
  134. <li class="right" >
  135. <a href="object.html" title="Object Protocol"
  136. accesskey="P">previous</a> |</li>
  137. <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  138. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  139. <li class="switchers">
  140. <div class="language_switcher_placeholder"></div>
  141. <div class="version_switcher_placeholder"></div>
  142. </li>
  143. <li>
  144. </li>
  145. <li id="cpython-language-and-version">
  146. <a href="../index.html">3.12.0 Documentation</a> &#187;
  147. </li>
  148. <li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> &#187;</li>
  149. <li class="nav-item nav-item-2"><a href="abstract.html" accesskey="U">Abstract Objects Layer</a> &#187;</li>
  150. <li class="nav-item nav-item-this"><a href="">Call Protocol</a></li>
  151. <li class="right">
  152. <div class="inline-search" role="search">
  153. <form class="inline-search" action="../search.html" method="get">
  154. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  155. <input type="submit" value="Go" />
  156. </form>
  157. </div>
  158. |
  159. </li>
  160. <li class="right">
  161. <label class="theme-selector-label">
  162. Theme
  163. <select class="theme-selector" oninput="activateTheme(this.value)">
  164. <option value="auto" selected>Auto</option>
  165. <option value="light">Light</option>
  166. <option value="dark">Dark</option>
  167. </select>
  168. </label> |</li>
  169. </ul>
  170. </div>
  171. <div class="document">
  172. <div class="documentwrapper">
  173. <div class="bodywrapper">
  174. <div class="body" role="main">
  175. <section id="call-protocol">
  176. <span id="call"></span><h1>Call Protocol<a class="headerlink" href="#call-protocol" title="Permalink to this headline">¶</a></h1>
  177. <p>CPython supports two different calling protocols:
  178. <em>tp_call</em> and vectorcall.</p>
  179. <section id="the-tp-call-protocol">
  180. <h2>The <em>tp_call</em> Protocol<a class="headerlink" href="#the-tp-call-protocol" title="Permalink to this headline">¶</a></h2>
  181. <p>Instances of classes that set <a class="reference internal" href="typeobj.html#c.PyTypeObject.tp_call" title="PyTypeObject.tp_call"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_call</span></code></a> are callable.
  182. The signature of the slot is:</p>
  183. <div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">PyObject</span><span class="w"> </span><span class="o">*</span><span class="nf">tp_call</span><span class="p">(</span><span class="n">PyObject</span><span class="w"> </span><span class="o">*</span><span class="n">callable</span><span class="p">,</span><span class="w"> </span><span class="n">PyObject</span><span class="w"> </span><span class="o">*</span><span class="n">args</span><span class="p">,</span><span class="w"> </span><span class="n">PyObject</span><span class="w"> </span><span class="o">*</span><span class="n">kwargs</span><span class="p">);</span>
  184. </pre></div>
  185. </div>
  186. <p>A call is made using a tuple for the positional arguments
  187. and a dict for the keyword arguments, similarly to
  188. <code class="docutils literal notranslate"><span class="pre">callable(*args,</span> <span class="pre">**kwargs)</span></code> in Python code.
  189. <em>args</em> must be non-NULL (use an empty tuple if there are no arguments)
  190. but <em>kwargs</em> may be <em>NULL</em> if there are no keyword arguments.</p>
  191. <p>This convention is not only used by <em>tp_call</em>:
  192. <a class="reference internal" href="typeobj.html#c.PyTypeObject.tp_new" title="PyTypeObject.tp_new"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_new</span></code></a> and <a class="reference internal" href="typeobj.html#c.PyTypeObject.tp_init" title="PyTypeObject.tp_init"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_init</span></code></a>
  193. also pass arguments this way.</p>
  194. <p>To call an object, use <a class="reference internal" href="#c.PyObject_Call" title="PyObject_Call"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_Call()</span></code></a> or another
  195. <a class="reference internal" href="#capi-call"><span class="std std-ref">call API</span></a>.</p>
  196. </section>
  197. <section id="the-vectorcall-protocol">
  198. <span id="vectorcall"></span><h2>The Vectorcall Protocol<a class="headerlink" href="#the-vectorcall-protocol" title="Permalink to this headline">¶</a></h2>
  199. <div class="versionadded">
  200. <p><span class="versionmodified added">New in version 3.9.</span></p>
  201. </div>
  202. <p>The vectorcall protocol was introduced in <span class="target" id="index-0"></span><a class="pep reference external" href="https://peps.python.org/pep-0590/"><strong>PEP 590</strong></a> as an additional protocol
  203. for making calls more efficient.</p>
  204. <p>As rule of thumb, CPython will prefer the vectorcall for internal calls
  205. if the callable supports it. However, this is not a hard rule.
  206. Additionally, some third-party extensions use <em>tp_call</em> directly
  207. (rather than using <a class="reference internal" href="#c.PyObject_Call" title="PyObject_Call"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_Call()</span></code></a>).
  208. Therefore, a class supporting vectorcall must also implement
  209. <a class="reference internal" href="typeobj.html#c.PyTypeObject.tp_call" title="PyTypeObject.tp_call"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_call</span></code></a>.
  210. Moreover, the callable must behave the same
  211. regardless of which protocol is used.
  212. The recommended way to achieve this is by setting
  213. <a class="reference internal" href="typeobj.html#c.PyTypeObject.tp_call" title="PyTypeObject.tp_call"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_call</span></code></a> to <a class="reference internal" href="#c.PyVectorcall_Call" title="PyVectorcall_Call"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyVectorcall_Call()</span></code></a>.
  214. This bears repeating:</p>
  215. <div class="admonition warning">
  216. <p class="admonition-title">Warning</p>
  217. <p>A class supporting vectorcall <strong>must</strong> also implement
  218. <a class="reference internal" href="typeobj.html#c.PyTypeObject.tp_call" title="PyTypeObject.tp_call"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_call</span></code></a> with the same semantics.</p>
  219. </div>
  220. <div class="versionchanged">
  221. <p><span class="versionmodified changed">Changed in version 3.12: </span>The <a class="reference internal" href="typeobj.html#c.Py_TPFLAGS_HAVE_VECTORCALL" title="Py_TPFLAGS_HAVE_VECTORCALL"><code class="xref c c-macro docutils literal notranslate"><span class="pre">Py_TPFLAGS_HAVE_VECTORCALL</span></code></a> flag is now removed from a class
  222. when the class’s <a class="reference internal" href="../reference/datamodel.html#object.__call__" title="object.__call__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__call__()</span></code></a> method is reassigned.
  223. (This internally sets <a class="reference internal" href="typeobj.html#c.PyTypeObject.tp_call" title="PyTypeObject.tp_call"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_call</span></code></a> only, and thus
  224. may make it behave differently than the vectorcall function.)
  225. In earlier Python versions, vectorcall should only be used with
  226. <a class="reference internal" href="typeobj.html#c.Py_TPFLAGS_IMMUTABLETYPE" title="Py_TPFLAGS_IMMUTABLETYPE"><code class="xref c c-macro docutils literal notranslate"><span class="pre">immutable</span></code></a> or static types.</p>
  227. </div>
  228. <p>A class should not implement vectorcall if that would be slower
  229. than <em>tp_call</em>. For example, if the callee needs to convert
  230. the arguments to an args tuple and kwargs dict anyway, then there is no point
  231. in implementing vectorcall.</p>
  232. <p>Classes can implement the vectorcall protocol by enabling the
  233. <a class="reference internal" href="typeobj.html#c.Py_TPFLAGS_HAVE_VECTORCALL" title="Py_TPFLAGS_HAVE_VECTORCALL"><code class="xref c c-macro docutils literal notranslate"><span class="pre">Py_TPFLAGS_HAVE_VECTORCALL</span></code></a> flag and setting
  234. <a class="reference internal" href="typeobj.html#c.PyTypeObject.tp_vectorcall_offset" title="PyTypeObject.tp_vectorcall_offset"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_vectorcall_offset</span></code></a> to the offset inside the
  235. object structure where a <em>vectorcallfunc</em> appears.
  236. This is a pointer to a function with the following signature:</p>
  237. <dl class="c type">
  238. <dt class="sig sig-object c" id="c.vectorcallfunc">
  239. <span class="k"><span class="pre">typedef</span></span><span class="w"> </span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">(</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">vectorcallfunc</span></span></span><span class="p"><span class="pre">)</span></span><span class="p"><span class="pre">(</span></span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">callable</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">nargsf</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">kwnames</span></span><span class="p"><span class="pre">)</span></span><a class="headerlink" href="#c.vectorcallfunc" title="Permalink to this definition">¶</a><br /></dt>
  240. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a> since version 3.12.</em></dd></dl>
  241. <ul class="simple">
  242. <li><p><em>callable</em> is the object being called.</p></li>
  243. <li><dl class="simple">
  244. <dt><em>args</em> is a C array consisting of the positional arguments followed by the</dt><dd><p>values of the keyword arguments.
  245. This can be <em>NULL</em> if there are no arguments.</p>
  246. </dd>
  247. </dl>
  248. </li>
  249. <li><dl class="simple">
  250. <dt><em>nargsf</em> is the number of positional arguments plus possibly the</dt><dd><p><a class="reference internal" href="#c.PY_VECTORCALL_ARGUMENTS_OFFSET" title="PY_VECTORCALL_ARGUMENTS_OFFSET"><code class="xref c c-macro docutils literal notranslate"><span class="pre">PY_VECTORCALL_ARGUMENTS_OFFSET</span></code></a> flag.
  251. To get the actual number of positional arguments from <em>nargsf</em>,
  252. use <a class="reference internal" href="#c.PyVectorcall_NARGS" title="PyVectorcall_NARGS"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyVectorcall_NARGS()</span></code></a>.</p>
  253. </dd>
  254. </dl>
  255. </li>
  256. <li><dl class="simple">
  257. <dt><em>kwnames</em> is a tuple containing the names of the keyword arguments;</dt><dd><p>in other words, the keys of the kwargs dict.
  258. These names must be strings (instances of <code class="docutils literal notranslate"><span class="pre">str</span></code> or a subclass)
  259. and they must be unique.
  260. If there are no keyword arguments, then <em>kwnames</em> can instead be <em>NULL</em>.</p>
  261. </dd>
  262. </dl>
  263. </li>
  264. </ul>
  265. <dl class="c macro">
  266. <dt class="sig sig-object c" id="c.PY_VECTORCALL_ARGUMENTS_OFFSET">
  267. <span class="sig-name descname"><span class="n"><span class="pre">PY_VECTORCALL_ARGUMENTS_OFFSET</span></span></span><a class="headerlink" href="#c.PY_VECTORCALL_ARGUMENTS_OFFSET" title="Permalink to this definition">¶</a><br /></dt>
  268. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a> since version 3.12.</em><p>If this flag is set in a vectorcall <em>nargsf</em> argument, the callee is allowed
  269. to temporarily change <code class="docutils literal notranslate"><span class="pre">args[-1]</span></code>. In other words, <em>args</em> points to
  270. argument 1 (not 0) in the allocated vector.
  271. The callee must restore the value of <code class="docutils literal notranslate"><span class="pre">args[-1]</span></code> before returning.</p>
  272. <p>For <a class="reference internal" href="#c.PyObject_VectorcallMethod" title="PyObject_VectorcallMethod"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_VectorcallMethod()</span></code></a>, this flag means instead that
  273. <code class="docutils literal notranslate"><span class="pre">args[0]</span></code> may be changed.</p>
  274. <p>Whenever they can do so cheaply (without additional allocation), callers
  275. are encouraged to use <a class="reference internal" href="#c.PY_VECTORCALL_ARGUMENTS_OFFSET" title="PY_VECTORCALL_ARGUMENTS_OFFSET"><code class="xref c c-macro docutils literal notranslate"><span class="pre">PY_VECTORCALL_ARGUMENTS_OFFSET</span></code></a>.
  276. Doing so will allow callables such as bound methods to make their onward
  277. calls (which include a prepended <em>self</em> argument) very efficiently.</p>
  278. </dd></dl>
  279. <p>To call an object that implements vectorcall, use a <a class="reference internal" href="#capi-call"><span class="std std-ref">call API</span></a>
  280. function as with any other callable.
  281. <a class="reference internal" href="#c.PyObject_Vectorcall" title="PyObject_Vectorcall"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_Vectorcall()</span></code></a> will usually be most efficient.</p>
  282. <div class="admonition note">
  283. <p class="admonition-title">Note</p>
  284. <p>In CPython 3.8, the vectorcall API and related functions were available
  285. provisionally under names with a leading underscore:
  286. <code class="docutils literal notranslate"><span class="pre">_PyObject_Vectorcall</span></code>, <code class="docutils literal notranslate"><span class="pre">_Py_TPFLAGS_HAVE_VECTORCALL</span></code>,
  287. <code class="docutils literal notranslate"><span class="pre">_PyObject_VectorcallMethod</span></code>, <code class="docutils literal notranslate"><span class="pre">_PyVectorcall_Function</span></code>,
  288. <code class="docutils literal notranslate"><span class="pre">_PyObject_CallOneArg</span></code>, <code class="docutils literal notranslate"><span class="pre">_PyObject_CallMethodNoArgs</span></code>,
  289. <code class="docutils literal notranslate"><span class="pre">_PyObject_CallMethodOneArg</span></code>.
  290. Additionally, <code class="docutils literal notranslate"><span class="pre">PyObject_VectorcallDict</span></code> was available as
  291. <code class="docutils literal notranslate"><span class="pre">_PyObject_FastCallDict</span></code>.
  292. The old names are still defined as aliases of the new, non-underscored names.</p>
  293. </div>
  294. <section id="recursion-control">
  295. <h3>Recursion Control<a class="headerlink" href="#recursion-control" title="Permalink to this headline">¶</a></h3>
  296. <p>When using <em>tp_call</em>, callees do not need to worry about
  297. <a class="reference internal" href="exceptions.html#recursion"><span class="std std-ref">recursion</span></a>: CPython uses
  298. <a class="reference internal" href="exceptions.html#c.Py_EnterRecursiveCall" title="Py_EnterRecursiveCall"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_EnterRecursiveCall()</span></code></a> and <a class="reference internal" href="exceptions.html#c.Py_LeaveRecursiveCall" title="Py_LeaveRecursiveCall"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_LeaveRecursiveCall()</span></code></a>
  299. for calls made using <em>tp_call</em>.</p>
  300. <p>For efficiency, this is not the case for calls done using vectorcall:
  301. the callee should use <em>Py_EnterRecursiveCall</em> and <em>Py_LeaveRecursiveCall</em>
  302. if needed.</p>
  303. </section>
  304. <section id="vectorcall-support-api">
  305. <h3>Vectorcall Support API<a class="headerlink" href="#vectorcall-support-api" title="Permalink to this headline">¶</a></h3>
  306. <dl class="c function">
  307. <dt class="sig sig-object c" id="c.PyVectorcall_NARGS">
  308. <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PyVectorcall_NARGS</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">nargsf</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyVectorcall_NARGS" title="Permalink to this definition">¶</a><br /></dt>
  309. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a> since version 3.12.</em><p>Given a vectorcall <em>nargsf</em> argument, return the actual number of
  310. arguments.
  311. Currently equivalent to:</p>
  312. <div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="p">(</span><span class="n">Py_ssize_t</span><span class="p">)(</span><span class="n">nargsf</span><span class="w"> </span><span class="o">&amp;</span><span class="w"> </span><span class="o">~</span><span class="n">PY_VECTORCALL_ARGUMENTS_OFFSET</span><span class="p">)</span>
  313. </pre></div>
  314. </div>
  315. <p>However, the function <code class="docutils literal notranslate"><span class="pre">PyVectorcall_NARGS</span></code> should be used to allow
  316. for future extensions.</p>
  317. <div class="versionadded">
  318. <p><span class="versionmodified added">New in version 3.8.</span></p>
  319. </div>
  320. </dd></dl>
  321. <dl class="c function">
  322. <dt class="sig sig-object c" id="c.PyVectorcall_Function">
  323. <a class="reference internal" href="#c.vectorcallfunc" title="vectorcallfunc"><span class="n"><span class="pre">vectorcallfunc</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PyVectorcall_Function</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">op</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyVectorcall_Function" title="Permalink to this definition">¶</a><br /></dt>
  324. <dd><p>If <em>op</em> does not support the vectorcall protocol (either because the type
  325. does not or because the specific instance does not), return <em>NULL</em>.
  326. Otherwise, return the vectorcall function pointer stored in <em>op</em>.
  327. This function never raises an exception.</p>
  328. <p>This is mostly useful to check whether or not <em>op</em> supports vectorcall,
  329. which can be done by checking <code class="docutils literal notranslate"><span class="pre">PyVectorcall_Function(op)</span> <span class="pre">!=</span> <span class="pre">NULL</span></code>.</p>
  330. <div class="versionadded">
  331. <p><span class="versionmodified added">New in version 3.9.</span></p>
  332. </div>
  333. </dd></dl>
  334. <dl class="c function">
  335. <dt class="sig sig-object c" id="c.PyVectorcall_Call">
  336. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyVectorcall_Call</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">callable</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">tuple</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">dict</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyVectorcall_Call" title="Permalink to this definition">¶</a><br /></dt>
  337. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a> since version 3.12.</em><p>Call <em>callable</em>’s <a class="reference internal" href="#c.vectorcallfunc" title="vectorcallfunc"><code class="xref c c-type docutils literal notranslate"><span class="pre">vectorcallfunc</span></code></a> with positional and keyword
  338. arguments given in a tuple and dict, respectively.</p>
  339. <p>This is a specialized function, intended to be put in the
  340. <a class="reference internal" href="typeobj.html#c.PyTypeObject.tp_call" title="PyTypeObject.tp_call"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_call</span></code></a> slot or be used in an implementation of <code class="docutils literal notranslate"><span class="pre">tp_call</span></code>.
  341. It does not check the <a class="reference internal" href="typeobj.html#c.Py_TPFLAGS_HAVE_VECTORCALL" title="Py_TPFLAGS_HAVE_VECTORCALL"><code class="xref c c-macro docutils literal notranslate"><span class="pre">Py_TPFLAGS_HAVE_VECTORCALL</span></code></a> flag
  342. and it does not fall back to <code class="docutils literal notranslate"><span class="pre">tp_call</span></code>.</p>
  343. <div class="versionadded">
  344. <p><span class="versionmodified added">New in version 3.8.</span></p>
  345. </div>
  346. </dd></dl>
  347. </section>
  348. </section>
  349. <section id="object-calling-api">
  350. <span id="capi-call"></span><h2>Object Calling API<a class="headerlink" href="#object-calling-api" title="Permalink to this headline">¶</a></h2>
  351. <p>Various functions are available for calling a Python object.
  352. Each converts its arguments to a convention supported by the called object –
  353. either <em>tp_call</em> or vectorcall.
  354. In order to do as little conversion as possible, pick one that best fits
  355. the format of data you have available.</p>
  356. <p>The following table summarizes the available functions;
  357. please see individual documentation for details.</p>
  358. <table class="docutils align-default">
  359. <colgroup>
  360. <col style="width: 44%" />
  361. <col style="width: 19%" />
  362. <col style="width: 21%" />
  363. <col style="width: 16%" />
  364. </colgroup>
  365. <thead>
  366. <tr class="row-odd"><th class="head"><p>Function</p></th>
  367. <th class="head"><p>callable</p></th>
  368. <th class="head"><p>args</p></th>
  369. <th class="head"><p>kwargs</p></th>
  370. </tr>
  371. </thead>
  372. <tbody>
  373. <tr class="row-even"><td><p><a class="reference internal" href="#c.PyObject_Call" title="PyObject_Call"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_Call()</span></code></a></p></td>
  374. <td><p><code class="docutils literal notranslate"><span class="pre">PyObject</span> <span class="pre">*</span></code></p></td>
  375. <td><p>tuple</p></td>
  376. <td><p>dict/<code class="docutils literal notranslate"><span class="pre">NULL</span></code></p></td>
  377. </tr>
  378. <tr class="row-odd"><td><p><a class="reference internal" href="#c.PyObject_CallNoArgs" title="PyObject_CallNoArgs"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallNoArgs()</span></code></a></p></td>
  379. <td><p><code class="docutils literal notranslate"><span class="pre">PyObject</span> <span class="pre">*</span></code></p></td>
  380. <td><p>—</p></td>
  381. <td><p>—</p></td>
  382. </tr>
  383. <tr class="row-even"><td><p><a class="reference internal" href="#c.PyObject_CallOneArg" title="PyObject_CallOneArg"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallOneArg()</span></code></a></p></td>
  384. <td><p><code class="docutils literal notranslate"><span class="pre">PyObject</span> <span class="pre">*</span></code></p></td>
  385. <td><p>1 object</p></td>
  386. <td><p>—</p></td>
  387. </tr>
  388. <tr class="row-odd"><td><p><a class="reference internal" href="#c.PyObject_CallObject" title="PyObject_CallObject"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallObject()</span></code></a></p></td>
  389. <td><p><code class="docutils literal notranslate"><span class="pre">PyObject</span> <span class="pre">*</span></code></p></td>
  390. <td><p>tuple/<code class="docutils literal notranslate"><span class="pre">NULL</span></code></p></td>
  391. <td><p>—</p></td>
  392. </tr>
  393. <tr class="row-even"><td><p><a class="reference internal" href="#c.PyObject_CallFunction" title="PyObject_CallFunction"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallFunction()</span></code></a></p></td>
  394. <td><p><code class="docutils literal notranslate"><span class="pre">PyObject</span> <span class="pre">*</span></code></p></td>
  395. <td><p>format</p></td>
  396. <td><p>—</p></td>
  397. </tr>
  398. <tr class="row-odd"><td><p><a class="reference internal" href="#c.PyObject_CallMethod" title="PyObject_CallMethod"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallMethod()</span></code></a></p></td>
  399. <td><p>obj + <code class="docutils literal notranslate"><span class="pre">char*</span></code></p></td>
  400. <td><p>format</p></td>
  401. <td><p>—</p></td>
  402. </tr>
  403. <tr class="row-even"><td><p><a class="reference internal" href="#c.PyObject_CallFunctionObjArgs" title="PyObject_CallFunctionObjArgs"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallFunctionObjArgs()</span></code></a></p></td>
  404. <td><p><code class="docutils literal notranslate"><span class="pre">PyObject</span> <span class="pre">*</span></code></p></td>
  405. <td><p>variadic</p></td>
  406. <td><p>—</p></td>
  407. </tr>
  408. <tr class="row-odd"><td><p><a class="reference internal" href="#c.PyObject_CallMethodObjArgs" title="PyObject_CallMethodObjArgs"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallMethodObjArgs()</span></code></a></p></td>
  409. <td><p>obj + name</p></td>
  410. <td><p>variadic</p></td>
  411. <td><p>—</p></td>
  412. </tr>
  413. <tr class="row-even"><td><p><a class="reference internal" href="#c.PyObject_CallMethodNoArgs" title="PyObject_CallMethodNoArgs"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallMethodNoArgs()</span></code></a></p></td>
  414. <td><p>obj + name</p></td>
  415. <td><p>—</p></td>
  416. <td><p>—</p></td>
  417. </tr>
  418. <tr class="row-odd"><td><p><a class="reference internal" href="#c.PyObject_CallMethodOneArg" title="PyObject_CallMethodOneArg"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallMethodOneArg()</span></code></a></p></td>
  419. <td><p>obj + name</p></td>
  420. <td><p>1 object</p></td>
  421. <td><p>—</p></td>
  422. </tr>
  423. <tr class="row-even"><td><p><a class="reference internal" href="#c.PyObject_Vectorcall" title="PyObject_Vectorcall"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_Vectorcall()</span></code></a></p></td>
  424. <td><p><code class="docutils literal notranslate"><span class="pre">PyObject</span> <span class="pre">*</span></code></p></td>
  425. <td><p>vectorcall</p></td>
  426. <td><p>vectorcall</p></td>
  427. </tr>
  428. <tr class="row-odd"><td><p><a class="reference internal" href="#c.PyObject_VectorcallDict" title="PyObject_VectorcallDict"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_VectorcallDict()</span></code></a></p></td>
  429. <td><p><code class="docutils literal notranslate"><span class="pre">PyObject</span> <span class="pre">*</span></code></p></td>
  430. <td><p>vectorcall</p></td>
  431. <td><p>dict/<code class="docutils literal notranslate"><span class="pre">NULL</span></code></p></td>
  432. </tr>
  433. <tr class="row-even"><td><p><a class="reference internal" href="#c.PyObject_VectorcallMethod" title="PyObject_VectorcallMethod"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_VectorcallMethod()</span></code></a></p></td>
  434. <td><p>arg + name</p></td>
  435. <td><p>vectorcall</p></td>
  436. <td><p>vectorcall</p></td>
  437. </tr>
  438. </tbody>
  439. </table>
  440. <dl class="c function">
  441. <dt class="sig sig-object c" id="c.PyObject_Call">
  442. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_Call</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">callable</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">kwargs</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_Call" title="Permalink to this definition">¶</a><br /></dt>
  443. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Call a callable Python object <em>callable</em>, with arguments given by the
  444. tuple <em>args</em>, and named arguments given by the dictionary <em>kwargs</em>.</p>
  445. <p><em>args</em> must not be <em>NULL</em>; use an empty tuple if no arguments are needed.
  446. If no named arguments are needed, <em>kwargs</em> can be <em>NULL</em>.</p>
  447. <p>Return the result of the call on success, or raise an exception and return
  448. <em>NULL</em> on failure.</p>
  449. <p>This is the equivalent of the Python expression:
  450. <code class="docutils literal notranslate"><span class="pre">callable(*args,</span> <span class="pre">**kwargs)</span></code>.</p>
  451. </dd></dl>
  452. <dl class="c function">
  453. <dt class="sig sig-object c" id="c.PyObject_CallNoArgs">
  454. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_CallNoArgs</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">callable</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_CallNoArgs" title="Permalink to this definition">¶</a><br /></dt>
  455. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a> since version 3.10.</em><p>Call a callable Python object <em>callable</em> without any arguments. It is the
  456. most efficient way to call a callable Python object without any argument.</p>
  457. <p>Return the result of the call on success, or raise an exception and return
  458. <em>NULL</em> on failure.</p>
  459. <div class="versionadded">
  460. <p><span class="versionmodified added">New in version 3.9.</span></p>
  461. </div>
  462. </dd></dl>
  463. <dl class="c function">
  464. <dt class="sig sig-object c" id="c.PyObject_CallOneArg">
  465. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_CallOneArg</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">callable</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_CallOneArg" title="Permalink to this definition">¶</a><br /></dt>
  466. <dd><p>Call a callable Python object <em>callable</em> with exactly 1 positional argument
  467. <em>arg</em> and no keyword arguments.</p>
  468. <p>Return the result of the call on success, or raise an exception and return
  469. <em>NULL</em> on failure.</p>
  470. <div class="versionadded">
  471. <p><span class="versionmodified added">New in version 3.9.</span></p>
  472. </div>
  473. </dd></dl>
  474. <dl class="c function">
  475. <dt class="sig sig-object c" id="c.PyObject_CallObject">
  476. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_CallObject</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">callable</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_CallObject" title="Permalink to this definition">¶</a><br /></dt>
  477. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Call a callable Python object <em>callable</em>, with arguments given by the
  478. tuple <em>args</em>. If no arguments are needed, then <em>args</em> can be <em>NULL</em>.</p>
  479. <p>Return the result of the call on success, or raise an exception and return
  480. <em>NULL</em> on failure.</p>
  481. <p>This is the equivalent of the Python expression: <code class="docutils literal notranslate"><span class="pre">callable(*args)</span></code>.</p>
  482. </dd></dl>
  483. <dl class="c function">
  484. <dt class="sig sig-object c" id="c.PyObject_CallFunction">
  485. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_CallFunction</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">callable</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">format</span></span>, <span class="p"><span class="pre">...</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_CallFunction" title="Permalink to this definition">¶</a><br /></dt>
  486. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Call a callable Python object <em>callable</em>, with a variable number of C arguments.
  487. The C arguments are described using a <a class="reference internal" href="arg.html#c.Py_BuildValue" title="Py_BuildValue"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_BuildValue()</span></code></a> style format
  488. string. The format can be <em>NULL</em>, indicating that no arguments are provided.</p>
  489. <p>Return the result of the call on success, or raise an exception and return
  490. <em>NULL</em> on failure.</p>
  491. <p>This is the equivalent of the Python expression: <code class="docutils literal notranslate"><span class="pre">callable(*args)</span></code>.</p>
  492. <p>Note that if you only pass <span class="c-expr sig sig-inline c"><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n">PyObject</span></a><span class="p">*</span></span> args,
  493. <a class="reference internal" href="#c.PyObject_CallFunctionObjArgs" title="PyObject_CallFunctionObjArgs"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallFunctionObjArgs()</span></code></a> is a faster alternative.</p>
  494. <div class="versionchanged">
  495. <p><span class="versionmodified changed">Changed in version 3.4: </span>The type of <em>format</em> was changed from <code class="docutils literal notranslate"><span class="pre">char</span> <span class="pre">*</span></code>.</p>
  496. </div>
  497. </dd></dl>
  498. <dl class="c function">
  499. <dt class="sig sig-object c" id="c.PyObject_CallMethod">
  500. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_CallMethod</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">format</span></span>, <span class="p"><span class="pre">...</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_CallMethod" title="Permalink to this definition">¶</a><br /></dt>
  501. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Call the method named <em>name</em> of object <em>obj</em> with a variable number of C
  502. arguments. The C arguments are described by a <a class="reference internal" href="arg.html#c.Py_BuildValue" title="Py_BuildValue"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_BuildValue()</span></code></a> format
  503. string that should produce a tuple.</p>
  504. <p>The format can be <em>NULL</em>, indicating that no arguments are provided.</p>
  505. <p>Return the result of the call on success, or raise an exception and return
  506. <em>NULL</em> on failure.</p>
  507. <p>This is the equivalent of the Python expression:
  508. <code class="docutils literal notranslate"><span class="pre">obj.name(arg1,</span> <span class="pre">arg2,</span> <span class="pre">...)</span></code>.</p>
  509. <p>Note that if you only pass <span class="c-expr sig sig-inline c"><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n">PyObject</span></a><span class="p">*</span></span> args,
  510. <a class="reference internal" href="#c.PyObject_CallMethodObjArgs" title="PyObject_CallMethodObjArgs"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_CallMethodObjArgs()</span></code></a> is a faster alternative.</p>
  511. <div class="versionchanged">
  512. <p><span class="versionmodified changed">Changed in version 3.4: </span>The types of <em>name</em> and <em>format</em> were changed from <code class="docutils literal notranslate"><span class="pre">char</span> <span class="pre">*</span></code>.</p>
  513. </div>
  514. </dd></dl>
  515. <dl class="c function">
  516. <dt class="sig sig-object c" id="c.PyObject_CallFunctionObjArgs">
  517. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_CallFunctionObjArgs</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">callable</span></span>, <span class="p"><span class="pre">...</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_CallFunctionObjArgs" title="Permalink to this definition">¶</a><br /></dt>
  518. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Call a callable Python object <em>callable</em>, with a variable number of
  519. <span class="c-expr sig sig-inline c"><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n">PyObject</span></a><span class="p">*</span></span> arguments. The arguments are provided as a variable number
  520. of parameters followed by <em>NULL</em>.</p>
  521. <p>Return the result of the call on success, or raise an exception and return
  522. <em>NULL</em> on failure.</p>
  523. <p>This is the equivalent of the Python expression:
  524. <code class="docutils literal notranslate"><span class="pre">callable(arg1,</span> <span class="pre">arg2,</span> <span class="pre">...)</span></code>.</p>
  525. </dd></dl>
  526. <dl class="c function">
  527. <dt class="sig sig-object c" id="c.PyObject_CallMethodObjArgs">
  528. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_CallMethodObjArgs</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <span class="p"><span class="pre">...</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_CallMethodObjArgs" title="Permalink to this definition">¶</a><br /></dt>
  529. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Call a method of the Python object <em>obj</em>, where the name of the method is given as a
  530. Python string object in <em>name</em>. It is called with a variable number of
  531. <span class="c-expr sig sig-inline c"><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n">PyObject</span></a><span class="p">*</span></span> arguments. The arguments are provided as a variable number
  532. of parameters followed by <em>NULL</em>.</p>
  533. <p>Return the result of the call on success, or raise an exception and return
  534. <em>NULL</em> on failure.</p>
  535. </dd></dl>
  536. <dl class="c function">
  537. <dt class="sig sig-object c" id="c.PyObject_CallMethodNoArgs">
  538. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_CallMethodNoArgs</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_CallMethodNoArgs" title="Permalink to this definition">¶</a><br /></dt>
  539. <dd><p>Call a method of the Python object <em>obj</em> without arguments,
  540. where the name of the method is given as a Python string object in <em>name</em>.</p>
  541. <p>Return the result of the call on success, or raise an exception and return
  542. <em>NULL</em> on failure.</p>
  543. <div class="versionadded">
  544. <p><span class="versionmodified added">New in version 3.9.</span></p>
  545. </div>
  546. </dd></dl>
  547. <dl class="c function">
  548. <dt class="sig sig-object c" id="c.PyObject_CallMethodOneArg">
  549. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_CallMethodOneArg</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">obj</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">arg</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_CallMethodOneArg" title="Permalink to this definition">¶</a><br /></dt>
  550. <dd><p>Call a method of the Python object <em>obj</em> with a single positional argument
  551. <em>arg</em>, where the name of the method is given as a Python string object in
  552. <em>name</em>.</p>
  553. <p>Return the result of the call on success, or raise an exception and return
  554. <em>NULL</em> on failure.</p>
  555. <div class="versionadded">
  556. <p><span class="versionmodified added">New in version 3.9.</span></p>
  557. </div>
  558. </dd></dl>
  559. <dl class="c function">
  560. <dt class="sig sig-object c" id="c.PyObject_Vectorcall">
  561. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_Vectorcall</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">callable</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">nargsf</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">kwnames</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_Vectorcall" title="Permalink to this definition">¶</a><br /></dt>
  562. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a> since version 3.12.</em><p>Call a callable Python object <em>callable</em>.
  563. The arguments are the same as for <a class="reference internal" href="#c.vectorcallfunc" title="vectorcallfunc"><code class="xref c c-type docutils literal notranslate"><span class="pre">vectorcallfunc</span></code></a>.
  564. If <em>callable</em> supports <a class="reference internal" href="#vectorcall">vectorcall</a>, this directly calls
  565. the vectorcall function stored in <em>callable</em>.</p>
  566. <p>Return the result of the call on success, or raise an exception and return
  567. <em>NULL</em> on failure.</p>
  568. <div class="versionadded">
  569. <p><span class="versionmodified added">New in version 3.9.</span></p>
  570. </div>
  571. </dd></dl>
  572. <dl class="c function">
  573. <dt class="sig sig-object c" id="c.PyObject_VectorcallDict">
  574. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_VectorcallDict</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">callable</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">nargsf</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">kwdict</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_VectorcallDict" title="Permalink to this definition">¶</a><br /></dt>
  575. <dd><p>Call <em>callable</em> with positional arguments passed exactly as in the <a class="reference internal" href="#vectorcall">vectorcall</a> protocol,
  576. but with keyword arguments passed as a dictionary <em>kwdict</em>.
  577. The <em>args</em> array contains only the positional arguments.</p>
  578. <p>Regardless of which protocol is used internally,
  579. a conversion of arguments needs to be done.
  580. Therefore, this function should only be used if the caller
  581. already has a dictionary ready to use for the keyword arguments,
  582. but not a tuple for the positional arguments.</p>
  583. <div class="versionadded">
  584. <p><span class="versionmodified added">New in version 3.9.</span></p>
  585. </div>
  586. </dd></dl>
  587. <dl class="c function">
  588. <dt class="sig sig-object c" id="c.PyObject_VectorcallMethod">
  589. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PyObject_VectorcallMethod</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">name</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n"><span class="pre">nargsf</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">kwnames</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyObject_VectorcallMethod" title="Permalink to this definition">¶</a><br /></dt>
  590. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a> since version 3.12.</em><p>Call a method using the vectorcall calling convention. The name of the method
  591. is given as a Python string <em>name</em>. The object whose method is called is
  592. <em>args[0]</em>, and the <em>args</em> array starting at <em>args[1]</em> represents the arguments
  593. of the call. There must be at least one positional argument.
  594. <em>nargsf</em> is the number of positional arguments including <em>args[0]</em>,
  595. plus <a class="reference internal" href="#c.PY_VECTORCALL_ARGUMENTS_OFFSET" title="PY_VECTORCALL_ARGUMENTS_OFFSET"><code class="xref c c-macro docutils literal notranslate"><span class="pre">PY_VECTORCALL_ARGUMENTS_OFFSET</span></code></a> if the value of <code class="docutils literal notranslate"><span class="pre">args[0]</span></code> may
  596. temporarily be changed. Keyword arguments can be passed just like in
  597. <a class="reference internal" href="#c.PyObject_Vectorcall" title="PyObject_Vectorcall"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_Vectorcall()</span></code></a>.</p>
  598. <p>If the object has the <a class="reference internal" href="typeobj.html#c.Py_TPFLAGS_METHOD_DESCRIPTOR" title="Py_TPFLAGS_METHOD_DESCRIPTOR"><code class="xref c c-macro docutils literal notranslate"><span class="pre">Py_TPFLAGS_METHOD_DESCRIPTOR</span></code></a> feature,
  599. this will call the unbound method object with the full
  600. <em>args</em> vector as arguments.</p>
  601. <p>Return the result of the call on success, or raise an exception and return
  602. <em>NULL</em> on failure.</p>
  603. <div class="versionadded">
  604. <p><span class="versionmodified added">New in version 3.9.</span></p>
  605. </div>
  606. </dd></dl>
  607. </section>
  608. <section id="call-support-api">
  609. <h2>Call Support API<a class="headerlink" href="#call-support-api" title="Permalink to this headline">¶</a></h2>
  610. <dl class="c function">
  611. <dt class="sig sig-object c" id="c.PyCallable_Check">
  612. <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PyCallable_Check</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyCallable_Check" title="Permalink to this definition">¶</a><br /></dt>
  613. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Determine if the object <em>o</em> is callable. Return <code class="docutils literal notranslate"><span class="pre">1</span></code> if the object is callable
  614. and <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise. This function always succeeds.</p>
  615. </dd></dl>
  616. </section>
  617. </section>
  618. <div class="clearer"></div>
  619. </div>
  620. </div>
  621. </div>
  622. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  623. <div class="sphinxsidebarwrapper">
  624. <div>
  625. <h3><a href="../contents.html">Table of Contents</a></h3>
  626. <ul>
  627. <li><a class="reference internal" href="#">Call Protocol</a><ul>
  628. <li><a class="reference internal" href="#the-tp-call-protocol">The <em>tp_call</em> Protocol</a></li>
  629. <li><a class="reference internal" href="#the-vectorcall-protocol">The Vectorcall Protocol</a><ul>
  630. <li><a class="reference internal" href="#recursion-control">Recursion Control</a></li>
  631. <li><a class="reference internal" href="#vectorcall-support-api">Vectorcall Support API</a></li>
  632. </ul>
  633. </li>
  634. <li><a class="reference internal" href="#object-calling-api">Object Calling API</a></li>
  635. <li><a class="reference internal" href="#call-support-api">Call Support API</a></li>
  636. </ul>
  637. </li>
  638. </ul>
  639. </div>
  640. <div>
  641. <h4>Previous topic</h4>
  642. <p class="topless"><a href="object.html"
  643. title="previous chapter">Object Protocol</a></p>
  644. </div>
  645. <div>
  646. <h4>Next topic</h4>
  647. <p class="topless"><a href="number.html"
  648. title="next chapter">Number Protocol</a></p>
  649. </div>
  650. <div role="note" aria-label="source link">
  651. <h3>This Page</h3>
  652. <ul class="this-page-menu">
  653. <li><a href="../bugs.html">Report a Bug</a></li>
  654. <li>
  655. <a href="https://github.com/python/cpython/blob/main/Doc/c-api/call.rst"
  656. rel="nofollow">Show Source
  657. </a>
  658. </li>
  659. </ul>
  660. </div>
  661. </div>
  662. </div>
  663. <div class="clearer"></div>
  664. </div>
  665. <div class="related" role="navigation" aria-label="related navigation">
  666. <h3>Navigation</h3>
  667. <ul>
  668. <li class="right" style="margin-right: 10px">
  669. <a href="../genindex.html" title="General Index"
  670. >index</a></li>
  671. <li class="right" >
  672. <a href="../py-modindex.html" title="Python Module Index"
  673. >modules</a> |</li>
  674. <li class="right" >
  675. <a href="number.html" title="Number Protocol"
  676. >next</a> |</li>
  677. <li class="right" >
  678. <a href="object.html" title="Object Protocol"
  679. >previous</a> |</li>
  680. <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  681. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  682. <li class="switchers">
  683. <div class="language_switcher_placeholder"></div>
  684. <div class="version_switcher_placeholder"></div>
  685. </li>
  686. <li>
  687. </li>
  688. <li id="cpython-language-and-version">
  689. <a href="../index.html">3.12.0 Documentation</a> &#187;
  690. </li>
  691. <li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> &#187;</li>
  692. <li class="nav-item nav-item-2"><a href="abstract.html" >Abstract Objects Layer</a> &#187;</li>
  693. <li class="nav-item nav-item-this"><a href="">Call Protocol</a></li>
  694. <li class="right">
  695. <div class="inline-search" role="search">
  696. <form class="inline-search" action="../search.html" method="get">
  697. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  698. <input type="submit" value="Go" />
  699. </form>
  700. </div>
  701. |
  702. </li>
  703. <li class="right">
  704. <label class="theme-selector-label">
  705. Theme
  706. <select class="theme-selector" oninput="activateTheme(this.value)">
  707. <option value="auto" selected>Auto</option>
  708. <option value="light">Light</option>
  709. <option value="dark">Dark</option>
  710. </select>
  711. </label> |</li>
  712. </ul>
  713. </div>
  714. <div class="footer">
  715. &copy; <a href="../copyright.html">Copyright</a> 2001-2023, Python Software Foundation.
  716. <br />
  717. This page is licensed under the Python Software Foundation License Version 2.
  718. <br />
  719. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
  720. <br />
  721. See <a href="/license.html">History and License</a> for more information.<br />
  722. <br />
  723. The Python Software Foundation is a non-profit corporation.
  724. <a href="https://www.python.org/psf/donations/">Please donate.</a>
  725. <br />
  726. <br />
  727. Last updated on Oct 02, 2023.
  728. <a href="/bugs.html">Found a bug</a>?
  729. <br />
  730. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
  731. </div>
  732. </body>
  733. </html>