[Python-checkins] python/dist/src/Doc/lib libcfgparser.tex, 1.38, 1.39

goodger at users.sourceforge.net goodger at users.sourceforge.net
Sun Oct 3 17:55:12 CEST 2004


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23768/Doc/lib

Modified Files:
	libcfgparser.tex 
Log Message:
SF bug #997050: Document, test, & check for non-string values in ConfigParser.  Moved the new string-only restriction added in rev. 1.65 to the SafeConfigParser class, leaving existing ConfigParser & RawConfigParser behavior alone, and documented the conditions under which non-string values work.

Index: libcfgparser.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcfgparser.tex,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- libcfgparser.tex	18 May 2004 04:24:02 -0000	1.38
+++ libcfgparser.tex	3 Oct 2004 15:55:09 -0000	1.39
@@ -238,10 +238,12 @@
 \end{methoddesc}
 
 \begin{methoddesc}{set}{section, option, value}
-If the given section exists, set the given option to the specified value;
-otherwise raise \exception{NoSectionError}.  \var{value} must be a
-string (\class{str} or \class{unicode}); if not, \exception{TypeError}
-is raised.
+If the given section exists, set the given option to the specified
+value; otherwise raise \exception{NoSectionError}.  While it is
+possible to use \class{RawConfigParser} (or \class{ConfigParser} with
+\var{raw} parameters set to true) for \emph{internal} storage of
+non-string values, full functionality (including interpolation and
+output to files) can only be achieved using string values.
 \versionadded{1.6}
 \end{methoddesc}
 
@@ -281,8 +283,6 @@
 
 The \class{ConfigParser} class extends some methods of the
 \class{RawConfigParser} interface, adding some optional arguments.
-The \class{SafeConfigParser} class implements the same extended
-interface.
 
 \begin{methoddesc}{get}{section, option\optional{, raw\optional{, vars}}}
 Get an \var{option} value for the named \var{section}.  All the
@@ -297,3 +297,17 @@
 same meaning as for the \method{get()} method.
 \versionadded{2.3}
 \end{methoddesc}
+
+
+\subsection{SafeConfigParser Objects \label{SafeConfigParser-objects}}
+
+The \class{SafeConfigParser} class implements the same extended
+interface as \class{ConfigParser}, with the following addition:
+
+\begin{methoddesc}{set}{section, option, value}
+If the given section exists, set the given option to the specified
+value; otherwise raise \exception{NoSectionError}.  \var{value} must
+be a string (\class{str} or \class{unicode}); if not,
+\exception{TypeError} is raised.
+\versionadded{2.4}
+\end{methoddesc}



More information about the Python-checkins mailing list