On this page
configparser.Interpolation
Prev: configparser.ExtendedInterpolation | Up: configparser | Next: configparser.InterpolationDepthError
Rel: configparser.BasicInterpolation, configparser.ConfigParser, configparser.ConverterMapping, configparser.DuplicateOptionError
Ref: docs.python.org — configparser.Interpolation
Tags: #public #python3 #stdlib #configparser
Import
import configparser
from configparser import Interpolation
Signature & Overview
configparser.Interpolation()
Dummy interpolation that passes the value through with no changes.
Methods & Attributes
Interpolation.before_get(self, parser, section, option, value, defaults)—Interpolation.before_getmethod/property.Interpolation.before_read(self, parser, section, option, value)—Interpolation.before_readmethod/property.Interpolation.before_set(self, parser, section, option, value)—Interpolation.before_setmethod/property.Interpolation.before_write(self, parser, section, option, value)—Interpolation.before_writemethod/property.
Usage
import configparser
# Base class for BasicInterpolation and ExtendedInterpolation (pass interpolation=None to disable)
assert issubclass(configparser.BasicInterpolation, configparser.Interpolation)
Gotchas
- Disable interpolation completely with
ConfigParser(interpolation=None)when reading values containing%(like URLs or passwords).
REPL Inspect
from configparser import Interpolation
help(Interpolation)
Linked from
Related notes
- tuts/python3/stdlib_module/configparser/ExtendedInterpolation Linked here; links to this page; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/InterpolationDepthError Linked here; links to this page; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/BasicInterpolation Linked here; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/ConfigParser Linked here; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/ConverterMapping Linked here; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/DuplicateOptionError Linked here; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/configparser/DuplicateSectionError shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/InterpolationError shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/InterpolationMissingOptionError shared tags: #configparser, #stdlib