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

configparser.SectionProxy

Prev: configparser.RawConfigParser | Up: configparser | Next: configparser.UnnamedSectionDisabledError
Rel: configparser.BasicInterpolation, configparser.ConfigParser, configparser.ConverterMapping, configparser.DuplicateOptionError
Ref: docs.python.org — configparser.SectionProxy
Tags: #public #python3 #stdlib #configparser


Import

import configparser
from configparser import SectionProxy

Signature & Overview

configparser.SectionProxy(parser, name)

A proxy for a single section from a parser.

Methods & Attributes

Usage

import configparser

cp = configparser.ConfigParser()
cp.read_string("[db]\nport = 5432\n")
sec = cp["db"]
assert isinstance(sec, configparser.SectionProxy) and sec.getint("port") == 5432

Gotchas

REPL Inspect

from configparser import SectionProxy
help(SectionProxy)

Linked from

Related notes