mirror of https://github.com/python/cpython
#7188: fix optionxform() docs.
This commit is contained in:
parent
84da0905e4
commit
dc0205296b
|
@ -334,12 +334,20 @@ RawConfigParser Objects
|
||||||
|
|
||||||
.. method:: RawConfigParser.optionxform(option)
|
.. method:: RawConfigParser.optionxform(option)
|
||||||
|
|
||||||
Transforms the option name *option* as found in an input file or as passed in by
|
Transforms the option name *option* as found in an input file or as passed in
|
||||||
client code to the form that should be used in the internal structures. The
|
by client code to the form that should be used in the internal structures.
|
||||||
default implementation returns a lower-case version of *option*; subclasses may
|
The default implementation returns a lower-case version of *option*;
|
||||||
override this or client code can set an attribute of this name on instances to
|
subclasses may override this or client code can set an attribute of this name
|
||||||
affect this behavior. Setting this to :func:`str`, for example, would make
|
on instances to affect this behavior.
|
||||||
option names case sensitive.
|
|
||||||
|
You don't necessarily need to subclass a ConfigParser to use this method, you
|
||||||
|
can also re-set it on an instance, to a function that takes a string
|
||||||
|
argument. Setting it to ``str``, for example, would make option names case
|
||||||
|
sensitive::
|
||||||
|
|
||||||
|
cfgparser = ConfigParser()
|
||||||
|
...
|
||||||
|
cfgparser.optionxform = str
|
||||||
|
|
||||||
|
|
||||||
.. _configparser-objects:
|
.. _configparser-objects:
|
||||||
|
|
Loading…
Reference in New Issue