From 8b8f2ec560136a6b4bf91726aaaff2376a725cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sat, 26 Mar 2011 07:22:01 +0100 Subject: Kill last reference to defunct module --- Doc/c-api/intro.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Doc') diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst index e8b62dc5fc..c008b5c93d 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() -- cgit v1.2.1 From a0b3c32c7a35422c1196824dce1a0c1f7f8969eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sat, 16 Apr 2011 23:47:53 +0200 Subject: Advertise nesting directives for class/method and class/data combos. Also fix a typo and a misleading example (method used to describe function). --- Doc/documenting/markup.rst | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'Doc') diff --git a/Doc/documenting/markup.rst b/Doc/documenting/markup.rst index 34a79d4372..be7718d82e 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 -- cgit v1.2.1 From 5c1a0c969d82670ba7aac7647b9828f4df85c1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Wed, 20 Apr 2011 19:11:12 +0200 Subject: Fix argument name in reST doc to match the code --- Doc/library/dbm.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Doc') diff --git a/Doc/library/dbm.rst b/Doc/library/dbm.rst index c7c73475eb..cbefc1aa11 100644 --- a/Doc/library/dbm.rst +++ b/Doc/library/dbm.rst @@ -30,9 +30,9 @@ the Oracle Berkeley DB. name, such as ``'dbm.ndbm'`` or ``'dbm.gnu'``. -.. function:: open(filename, flag='r', mode=0o666) +.. function:: open(file, flag='r', mode=0o666) - Open the database file *filename* and return a corresponding object. + Open the database file *file* and return a corresponding object. If the database file already exists, the :func:`whichdb` function is used to determine its type and the appropriate module is used; if it does not exist, -- cgit v1.2.1 From de579d4359e0088feb36bb4be080c2ab36cd9365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Thu, 21 Apr 2011 02:37:41 +0200 Subject: Add a space to make json doc a bit more readable --- Doc/library/json.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Doc') diff --git a/Doc/library/json.rst b/Doc/library/json.rst index 6bb48e81ef..48acaf19d6 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -34,7 +34,7 @@ Encoding basic Python object hierarchies:: Compact encoding:: >>> import json - >>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':')) + >>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',', ':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: -- cgit v1.2.1 From 2b9388a03325fa4452a8cb3b9df8a7fbb7302b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 22 Apr 2011 21:27:10 +0200 Subject: Fix weird executable name --- Doc/distutils/examples.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Doc') diff --git a/Doc/distutils/examples.rst b/Doc/distutils/examples.rst index 6c2773874c..e8d1ec9937 100644 --- a/Doc/distutils/examples.rst +++ b/Doc/distutils/examples.rst @@ -280,7 +280,7 @@ For example, if the :file:`setup.py` script is changed like this:: Where the long description is broken, ``check`` will be able to detect it by using the :mod:`docutils` parser:: - $ pythontrunk setup.py check --restructuredtext + $ python setup.py check --restructuredtext running check warning: check: Title underline too short. (line 2) warning: check: Could not finish the parsing. -- cgit v1.2.1