From f9b0cc7df6f5d0c9350edb4b587b851170fdeb18 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Fri, 31 Jan 2003 18:52:45 +0000 Subject: [PATCH] Document __module__. --- Doc/ref/ref3.tex | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Doc/ref/ref3.tex b/Doc/ref/ref3.tex index a109678a2b4..064794e4e3c 100644 --- a/Doc/ref/ref3.tex +++ b/Doc/ref/ref3.tex @@ -436,8 +436,10 @@ parameter list. \obindex{user-defined function} Special attributes: \member{func_doc} or \member{__doc__} is the -function's documentation string, or None if unavailable; +function's documentation string, or \code{None} if unavailable; \member{func_name} or \member{__name__} is the function's name; +\member{__module__} is the name of the module the function was defined +in, or \code{None} if unavailable; \member{func_defaults} is a tuple containing default argument values for those arguments that have defaults, or \code{None} if no arguments have a default value; \member{func_code} is the code object representing @@ -460,6 +462,7 @@ description of internal types below. \ttindex{func_doc} \ttindex{__doc__} \ttindex{__name__} + \ttindex{__module__} \ttindex{__dict__} \ttindex{func_defaults} \ttindex{func_closure} @@ -482,10 +485,14 @@ object, \member{im_func} is the function object; or the class that asked for the method for unbound methods); \member{__doc__} is the method's documentation (same as \code{im_func.__doc__}); \member{__name__} is the method name (same as -\code{im_func.__name__}). +\code{im_func.__name__}); \member{__module__} is the name of the +module the method was defined in, or \code{None} if unavailable. \versionchanged[\member{im_self} used to refer to the class that defined the method]{2.2} \withsubitem{(method attribute)}{ + \ttindex{__doc__} + \ttindex{__name__} + \ttindex{__module__} \ttindex{im_func} \ttindex{im_self}} @@ -555,7 +562,8 @@ determined by the C function. Special read-only attributes: \member{__doc__} is the function's documentation string, or \code{None} if unavailable; \member{__name__} is the function's name; \member{__self__} is set to \code{None} (but see -the next item). +the next item); \member{__module__} is the name of the module the +function was defined in or \code{None} if unavailable. \obindex{built-in function} \obindex{function} \indexii{C}{language}