summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzyman <devnull@localhost>2010-03-01 23:32:10 +0000
committerfuzzyman <devnull@localhost>2010-03-01 23:32:10 +0000
commit24cdd631a048a479e0d585233892139787c16044 (patch)
tree0e7621a2fac9368e7b85360ad51b0e82fc3475ed
parentd251b81988f185e13796da6463fac8baaf48dc0a (diff)
downloadconfigobj-24cdd631a048a479e0d585233892139787c16044.tar.gz
Doc changes.
-rw-r--r--docs/configobj.txt31
-rw-r--r--setup.py2
2 files changed, 32 insertions, 1 deletions
diff --git a/docs/configobj.txt b/docs/configobj.txt
index f86246d..334ec8b 100644
--- a/docs/configobj.txt
+++ b/docs/configobj.txt
@@ -2034,6 +2034,13 @@ which discards comments.
String Interpolation
====================
+.. note::
+
+ String interpolation can slow down (slightly) the fetching of values
+ from your config object. If you aren't using interpolation and it
+ is performance critical then create your instance with
+ ``interpolation=False``.
+
ConfigObj allows string interpolation *similar* to the way ``ConfigParser``
or ``string.Template`` work. The value of the ``interpolation`` attribute
determines which style of interpolation you want to use. Valid values are
@@ -2090,6 +2097,30 @@ New in ConfigObj 4.7.0: String interpolation is now done in members of list
values.
+String Interpolation and List Values
+------------------------------------
+
+Since version 4.7 string interpolation is done on string members of list values.
+If interpolation changes any members of the list then what you get back is a
+*copy* of the list rather than the original list.
+
+This makes fetching list values slightly slower when interpolation is on, it
+also means that if you mutate the list changes won't be reflected in the
+original list:
+
+.. code-block:: python
+
+ >>> c = ConfigObj()
+ >>> c['foo'] = 'boo'
+ >>> c['bar'] = ['%(foo)s']
+ >>> c['bar']
+ ['boo']
+ >>> c['bar'].append('fish')
+ >>> c['bar']
+ ['boo']
+
+Instead of mutating the list you must create a new list and reassign it.
+
Comments
========
diff --git a/setup.py b/setup.py
index 3d397e2..63d70cc 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ NAME = 'configobj'
MODULES = 'configobj', 'validate'
-DESCRIPTION = 'Config file reading, writing, and validation.'
+DESCRIPTION = 'Config file reading, writing and validation.'
URL = 'http://www.voidspace.org.uk/python/configobj.html'