[docs] [issue26094] ConfigParser.get() doc to be updated according to the configparser.py header doc
report at bugs.python.org
Tue Jan 12 19:39:59 EST 2016
New submission from khyox:
For the sake of clarity, in https://docs.python.org/3.5/library/configparser.html#configparser.ConfigParser the ConfigParser.get() method doc could be properly updated with merging the information written in the header doc of the source file, as found in https://hg.python.org/cpython/file/3.5/Lib/configparser.py
Concretely, this sentence there, "Return a string value for the named option." could be considered quite relevant to be added to the doc of the method, as some packages are (incorrectly) expecting boolean values returned by the ConfigParser.get() method. The reality is that a "True" in the configuration file is returning the string "True" and not the boolean constant True.
To sum up, the suggested update would be:
def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):
"""Returns a string value for the named option for a given section.
If `vars' is provided, it must be a dictionary. The option is looked up
in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
If the key is not found and `fallback' is provided, it is used as
a fallback value. `None' can be provided as a `fallback' value.
If interpolation is enabled and the optional argument `raw' is False,
all interpolations are expanded in the return values.
Arguments `raw', `vars', and `fallback' are keyword only.
The section DEFAULT is special.
assignee: docs at python
nosy: docs at python, khyox
title: ConfigParser.get() doc to be updated according to the configparser.py header doc
versions: Python 3.5, Python 3.6
Python tracker <report at bugs.python.org>
More information about the docs