]> granicus.if.org Git - python/commitdiff
Closes #19071: "self" argument is not the module for module functions in 2.x.
authorGeorg Brandl <georg@python.org>
Mon, 6 Oct 2014 16:01:02 +0000 (18:01 +0200)
committerGeorg Brandl <georg@python.org>
Mon, 6 Oct 2014 16:01:02 +0000 (18:01 +0200)
Doc/extending/extending.rst

index 8e8c3ab575bf5bee774dc4fd07123eb23ff2bc9c..5488ce908843879e2e2c84a77d47bc9f6fa3a739 100644 (file)
@@ -89,8 +89,9 @@ example, the single expression ``"ls -l"``) to the arguments passed to the C
 function.  The C function always has two arguments, conventionally named *self*
 and *args*.
 
-The *self* argument points to the module object for module-level functions;
-for a method it would point to the object instance.
+For module functions, the *self* argument is *NULL* or a pointer selected while
+initializing the module (see :c:func:`Py_InitModule4`).  For a method, it would
+point to the object instance.
 
 The *args* argument will be a pointer to a Python tuple object containing the
 arguments.  Each item of the tuple corresponds to an argument in the call's