Index: Lib/ConfigParser.py =================================================================== --- Lib/ConfigParser.py (revision 60566) +++ Lib/ConfigParser.py (working copy) @@ -511,12 +511,13 @@ def get(self, section, option, raw=False, vars=None): """Get an option value for a given section. - All % interpolations are expanded in the return values, based on the - defaults passed into the constructor, unless the optional argument - `raw' is true. Additional substitutions may be provided using the - `vars' argument, which must be a dictionary whose contents overrides - any pre-existing defaults. + If `vars' is provided, it must be a dictionary. The option is looked + up in `vars' (if provided), `section', and in `defaults' in that + order. + All % interpolations are expanded in the return values, unless the + optional argument `raw' is true. + The section DEFAULT is special. """ d = self._defaults.copy() Index: Doc/library/configparser.rst =================================================================== --- Doc/library/configparser.rst (revision 60566) +++ Doc/library/configparser.rst (working copy) @@ -32,7 +32,7 @@ :rfc:`822`; ``name=value`` is also accepted. Note that leading whitespace is removed from values. The optional values can contain format strings which refer to other values in the same section, or values in a special ``DEFAULT`` section. -Additional defaults can be provided on initialization and retrieval. Lines +Additional defaults can be provided on initialization. Lines beginning with ``'#'`` or ``';'`` are ignored and may be used to provide comments. @@ -46,8 +46,7 @@ All reference expansions are done on demand. Default values can be specified by passing them into the :class:`ConfigParser` -constructor as a dictionary. Additional defaults may be passed into the -:meth:`get` method which will override all others. +constructor as a dictionary. Sections are normally stored in a builtin dictionary. An alternative dictionary type can be passed to the :class:`ConfigParser` constructor. For example, if a @@ -328,11 +327,12 @@ .. method:: ConfigParser.get(section, option[, raw[, vars]]) - Get an *option* value for the named *section*. All the ``'%'`` interpolations - are expanded in the return values, based on the defaults passed into the - constructor, as well as the options *vars* provided, unless the *raw* argument - is true. + Get an *option* value for the named *section*. If *vars* is provided, it + must be a dictionary. The *option* is looked up in *vars* (if provided), + *section*, and in *defaults* in that order. + All the ``'%'`` interpolations are expanded in the return values, unless + the optional argument `raw' is true. .. method:: ConfigParser.items(section[, raw[, vars]])