summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-10-23 08:14:44 (GMT)
committerGeorg Brandl <georg@python.org>2009-10-23 08:14:44 (GMT)
commitdc0205296b082b303c726d93c019e7e20fdc687b (patch)
tree22058a0d37118d7fcd8702bcf1b9bbb525404e1c
parent84da0905e4c484f84e3572305e1e7ab58f72c141 (diff)
downloadcpython-dc0205296b082b303c726d93c019e7e20fdc687b.zip
cpython-dc0205296b082b303c726d93c019e7e20fdc687b.tar.gz
cpython-dc0205296b082b303c726d93c019e7e20fdc687b.tar.bz2
#7188: fix optionxform() docs.
-rw-r--r--Doc/library/configparser.rst20
1 files changed, 14 insertions, 6 deletions
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst
index ef27524..1af14cc 100644
--- a/Doc/library/configparser.rst
+++ b/Doc/library/configparser.rst
@@ -334,12 +334,20 @@ RawConfigParser Objects
.. method:: RawConfigParser.optionxform(option)
- Transforms the option name *option* as found in an input file or as passed in by
- client code to the form that should be used in the internal structures. The
- default implementation returns a lower-case version of *option*; subclasses may
- override this or client code can set an attribute of this name on instances to
- affect this behavior. Setting this to :func:`str`, for example, would make
- option names case sensitive.
+ Transforms the option name *option* as found in an input file or as passed in
+ by client code to the form that should be used in the internal structures.
+ The default implementation returns a lower-case version of *option*;
+ subclasses may override this or client code can set an attribute of this name
+ on instances to affect this behavior.
+
+ 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: