5.5 Text substitution

Text in an option setting may include text from other option settings. String substitutions are implemented using Python's mapped key string formatting style. The name of the option to use to substitute text is containted within the string formatting code.

For example:

path = %(base)s\site-packages
base = C:\Python24\lib

Is equivalent to:

path = C:\Python24\lib\site-packages

The text substitution option must exist in the same section or in the [DEFAULT] section.

For example, this works:

[DEFAULT]
base = C:\Python24\lib
[SECTION1]
path = %(base)s\site-packages

But this does not:

[SECTION0]
base = C:\Python24\lib
[SECTION1]
path = %(base)s\site-packages

Nesting is only allowed up to 10 levels deep in order to prevent endless loops.