Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Better documentation
  • Loading branch information
pslacerda1 committed Mar 29, 2024
commit 80d566bbe627ad6ae035a100521cd480f2b1946b
7 changes: 4 additions & 3 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ For example:

Unnamed sections
----------------

THe name of the first section (or unique) can be ommitted and values
retrieved by the :attr:`UNNAMED_SECTION` attribute.

Expand All @@ -342,9 +343,9 @@ retrieved by the :attr:`UNNAMED_SECTION` attribute.
... [ Section 2 ]
... another = val
... """
>>> typical = configparser.ConfigParser(allow_unamed_section=True)
>>> typical.read_string(config)
>>> config.get(UNNAMED_SECTION, 'option')
>>> unnamed = configparser.ConfigParser(allow_unamed_section=True)
>>> unnamed.read_string(config)
>>> unnamed.get(UNNAMED_SECTION, 'option')
'value'

Interpolation of values
Expand Down