[New-bugs-announce] [issue8666] Allow ConfigParser.get*() to take a default value

Tim Chase report at bugs.python.org
Sat May 8 21:56:34 CEST 2010


New submission from Tim Chase <python.list at tim.thechases.com>:

Patch to update ConfigParser.py so that the .get* methods can take an optional parameter rather than raising exceptions.  Usage:

  cp = ConfigParser(...)
  # ...
  value = cp.get('MySection', 'MyOption', default='some default')
  i = cp.getint('MySecton', 'MyInt', default=42)
  f = cp.getfloat('MySection', 'MyF', default=3.14)

----------
components: Library (Lib)
messages: 105333
nosy: Gumnos
priority: normal
severity: normal
status: open
title: Allow ConfigParser.get*() to take a default value
type: feature request
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8666>
_______________________________________


More information about the New-bugs-announce mailing list