[issue9421] configparser.ConfigParser's getint, getboolean and getfloat don't accept `vars`

Fred L. Drake, Jr. report at bugs.python.org
Tue Aug 10 13:15:44 CEST 2010


Fred L. Drake, Jr. <fdrake at acm.org> added the comment:

- Using _UNSET & similar in the docs is not good; there used to be a
  way to note a parameter as optional.  Not sure whether there is any
  more.

- Docs for methods which take vars/default should include a note
  indicating where to find the explanation, since reference docs are
  often read in a non-linear manner.

- This is a tortured way to only do something in a particular condition:

    value = str(value) if value is not None else None

  These two lines are actually more readable, since it's clear that
  the branch is a no-op:

    if value is not None:
        value = str(value)

- _unify_boolean is a strange name; doesn't parallel _unify_values at
  all.

- Having _COMPATIBLE and _UNSET defined in the classes looks more
  painful than not; no need to change for this patch.  (Should be
  changed in some later cleanup.)  Moving the whole _unify_boolean /
  _boolean_states mess to a separate top-level function that can be
  used for the conversion is attractive.

----------

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


More information about the Python-bugs-list mailing list