5.3 Sections

A configuration file may contain one or more sections to store multiple settings of the same option. A section is started with a line that contains a section name enclosed in [ ] and all option settings that follow are part of that section until the next section is reached. If the file contains no section names all settings are deposited into the [DEFAULT] section. If options settings exist before the first section in a file, those option settings are a part of the [DEFAULT] section. Simple section names can be considered as keys into a dictionary.

For example:

[DEFAULT]
opt1 = v_default

[section1]
opt1 = v_section1

Can be thought of as:

opt1 = { 'DEFAULT' : 'v_default',
         'section1' : 'v_section1' }