[Python-checkins] cpython (2.7): Closes #19071: "self" argument is not the module for module functions in 2.x.

georg.brandl python-checkins at python.org
Mon Oct 6 18:01:51 CEST 2014


https://hg.python.org/cpython/rev/59fe0ff02c90
changeset: 92861:59fe0ff02c90
branch: 2.7
parent: 92858:09782fad1825
user: Georg Brandl <georg at python.org>
date: Mon Oct 06 18:01:02 2014 +0200
summary:
 Closes #19071: "self" argument is not the module for module functions in 2.x.
files:
 Doc/extending/extending.rst | 5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst
--- a/Doc/extending/extending.rst
+++ b/Doc/extending/extending.rst
@@ -89,8 +89,9 @@
 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
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /