summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/c-api%2Fmethod.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/python~3.12/c-api%2Fmethod.html
new repository
Diffstat (limited to 'devdocs/python~3.12/c-api%2Fmethod.html')
-rw-r--r--devdocs/python~3.12/c-api%2Fmethod.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/devdocs/python~3.12/c-api%2Fmethod.html b/devdocs/python~3.12/c-api%2Fmethod.html
new file mode 100644
index 00000000..492a7ca1
--- /dev/null
+++ b/devdocs/python~3.12/c-api%2Fmethod.html
@@ -0,0 +1,21 @@
+ <span id="instancemethod-objects"></span><h1>Instance Method Objects</h1> <p id="index-0">An instance method is a wrapper for a <a class="reference internal" href="structures#c.PyCFunction" title="PyCFunction"><code>PyCFunction</code></a> and the new way to bind a <a class="reference internal" href="structures#c.PyCFunction" title="PyCFunction"><code>PyCFunction</code></a> to a class object. It replaces the former call <code>PyMethod_New(func, NULL, class)</code>.</p> <dl class="c var"> <dt class="sig sig-object c" id="c.PyInstanceMethod_Type">
+<code>PyTypeObject PyInstanceMethod_Type</code> </dt> <dd>
+<p>This instance of <a class="reference internal" href="type#c.PyTypeObject" title="PyTypeObject"><code>PyTypeObject</code></a> represents the Python instance method type. It is not exposed to Python programs.</p> </dd>
+</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyInstanceMethod_Check">
+<code>int PyInstanceMethod_Check(PyObject *o)</code> </dt> <dd>
+<p>Return true if <em>o</em> is an instance method object (has type <a class="reference internal" href="#c.PyInstanceMethod_Type" title="PyInstanceMethod_Type"><code>PyInstanceMethod_Type</code></a>). The parameter 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.PyInstanceMethod_New">
+<code>PyObject *PyInstanceMethod_New(PyObject *func)</code> </dt> <dd>
+<em class="refcount">Return value: New reference.</em><p>Return a new instance method object, with <em>func</em> being any callable object. <em>func</em> is the function that will be called when the instance method is called.</p> </dd>
+</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyInstanceMethod_Function">
+<code>PyObject *PyInstanceMethod_Function(PyObject *im)</code> </dt> <dd>
+<em class="refcount">Return value: Borrowed reference.</em><p>Return the function object associated with the instance method <em>im</em>.</p> </dd>
+</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyInstanceMethod_GET_FUNCTION">
+<code>PyObject *PyInstanceMethod_GET_FUNCTION(PyObject *im)</code> </dt> <dd>
+<em class="refcount">Return value: Borrowed reference.</em><p>Macro version of <a class="reference internal" href="#c.PyInstanceMethod_Function" title="PyInstanceMethod_Function"><code>PyInstanceMethod_Function()</code></a> which avoids error checking.</p> </dd>
+</dl> <div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2001&ndash;2023 Python Software Foundation<br>Licensed under the PSF License.<br>
+ <a href="https://docs.python.org/3.12/c-api/method.html" class="_attribution-link">https://docs.python.org/3.12/c-api/method.html</a>
+ </p>
+</div>