mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
ConfigParser:
- ensure that option names in interpolations are handled by self.optionxform in the same way that other references to option names - add tests, documentation (closes SF bug #857881, patch #865455)
This commit is contained in:
parent
beddfcb6d0
commit
bc12b01d83
3 changed files with 24 additions and 5 deletions
|
|
@ -62,6 +62,13 @@ and \method{items()} methods. The values in \var{defaults} must be
|
|||
appropriate for the \samp{\%()s} string interpolation. Note that
|
||||
\var{__name__} is an intrinsic default; its value is the section name,
|
||||
and will override any value provided in \var{defaults}.
|
||||
|
||||
All option names used in interpolation will be passed through the
|
||||
\method{optionxform()} method just like any other option name
|
||||
reference. For example, using the default implementation of
|
||||
\method{optionxform()} (which converts option names to lower case),
|
||||
the values \samp{foo \%(bar)s} and \samp{foo \%(BAR)s} are
|
||||
equivalent.
|
||||
\end{classdesc}
|
||||
|
||||
\begin{classdesc}{SafeConfigParser}{\optional{defaults}}
|
||||
|
|
@ -271,6 +278,8 @@ option names case sensitive.
|
|||
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue