On this page
  1. configparser.ExtendedInterpolation
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

configparser.ExtendedInterpolation

Prev: configparser.DuplicateSectionError | Up: configparser | Next: configparser.Interpolation
Rel: configparser.BasicInterpolation, configparser.ConfigParser, configparser.ConverterMapping, configparser.DuplicateOptionError
Ref: docs.python.org — configparser.ExtendedInterpolation
Tags: #public #python3 #stdlib #configparser


Import

import configparser
from configparser import ExtendedInterpolation

Signature & Overview

configparser.ExtendedInterpolation()

Advanced variant of interpolation, supports the syntax used by zc.buildout. Enables interpolation between sections.

Methods & Attributes

Usage

import configparser

cp = configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation())
cp.read_string("[common]\nroot=/srv\n[app]\ndata=${common:root}/data\n")
assert cp["app"]["data"] == "/srv/data"

Gotchas

REPL Inspect

from configparser import ExtendedInterpolation
help(ExtendedInterpolation)

Linked from

Related notes