diff options
author | Éric Araujo <merwok@netwok.org> | 2011-04-20 16:54:12 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-04-20 16:54:12 (GMT) |
commit | ad0790e5730173a6c649b59ae035549e3f2ba481 (patch) | |
tree | c3255b0146a5fb87c35fe15c4460606ceecdc6f5 /Doc | |
parent | 58de6ee8711a079da0b555221ae739d6a69df2f7 (diff) | |
parent | f8e1b607994028c826401c7f6f3637d9c797ed25 (diff) | |
download | cpython-ad0790e5730173a6c649b59ae035549e3f2ba481.zip cpython-ad0790e5730173a6c649b59ae035549e3f2ba481.tar.gz cpython-ad0790e5730173a6c649b59ae035549e3f2ba481.tar.bz2 |
Branch merge
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/intro.rst | 3 | ||||
-rw-r--r-- | Doc/documenting/markup.rst | 25 |
2 files changed, 22 insertions, 6 deletions
diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst index e8b62dc..c008b5c 100644 --- a/Doc/c-api/intro.rst +++ b/Doc/c-api/intro.rst @@ -511,13 +511,12 @@ interpreter can only be used after the interpreter has been initialized. module: builtins module: __main__ module: sys - module: exceptions triple: module; search; path single: path (in module sys) The basic initialization function is :cfunc:`Py_Initialize`. This initializes the table of loaded modules, and creates the fundamental modules -:mod:`builtins`, :mod:`__main__`, :mod:`sys`, and :mod:`exceptions`. It also +:mod:`builtins`, :mod:`__main__`, and :mod:`sys`. It also initializes the module search path (``sys.path``). .. index:: single: PySys_SetArgv() diff --git a/Doc/documenting/markup.rst b/Doc/documenting/markup.rst index 34a79d4..be7718d 100644 --- a/Doc/documenting/markup.rst +++ b/Doc/documenting/markup.rst @@ -152,7 +152,7 @@ The directives are: Describes global data in a module, including both variables and values used as "defined constants." Class and object attributes are not documented - using this environment. + using this directive. .. describe:: exception @@ -165,7 +165,7 @@ The directives are: parameters, enclosing optional parameters in brackets. Default values can be given if it enhances clarity. For example:: - .. function:: Timer.repeat([repeat=3[, number=1000000]]) + .. function:: repeat([repeat=3[, number=1000000]]) Object methods are not documented using this directive. Bound object methods placed in the module namespace as part of the public interface of the module @@ -186,13 +186,30 @@ The directives are: Describes an object data attribute. The description should include information about the type of the data to be expected and whether it may be - changed directly. + changed directly. This directive should be nested in a class directive, + like in this example:: + + .. class:: Spam + + Description of the class. + + .. data:: ham + + Description of the attribute. + + If is also possible to document an attribute outside of a class directive, + for example if the documentation for different attributes and methods is + split in multiple sections. The class name should then be included + explicitly:: + + .. data:: Spam.eggs .. describe:: method Describes an object method. The parameters should not include the ``self`` parameter. The description should include similar information to that - described for ``function``. + described for ``function``. This method should be nested in a class + method, like in the example above. .. describe:: opcode |