Message111986
ConfigParser (and in effect SafeConfigParser) accept `vars` in the `get()` method so one can override values from the section, merge data from different sources or simply state some required keys for interpolation.
`getint()`, `getfloat()` and `getboolean()` don't accept this argument and this is the reason for this issue: for all getters to present a consistent interface.
There is a small design question here however. We have an inheritance model in configparser that goes like this:
RawConfigParser -> ConfigParser -> SafeConfigParser
ConfigParser redefines `get()` for the purposes of interpolation but doesn't touch the other getters. It's good because in terms of implementation, they are just `type()` decoration over `get()` where type is `int`, `float` or `bool`.
The obvious solution would be to add **kwargs to these getters so that regardless of the implementation of the actual `get()`, all possible values are being passed to it. We can then comment in the docstring that for possible values of **kwargs, the user should check the interface of `get()`. Is that good enough?
Other ideas?
PS. I have a patch for the proposed design, will attach if there's consensus. |
|
Date |
User |
Action |
Args |
2010-07-29 18:32:49 | lukasz.langa | set | recipients:
+ lukasz.langa, georg.brandl, pitrou, michael.foord |
2010-07-29 18:32:49 | lukasz.langa | set | messageid: <1280428369.21.0.84678458473.issue9421@psf.upfronthosting.co.za> |
2010-07-29 18:32:42 | lukasz.langa | link | issue9421 messages |
2010-07-29 18:32:41 | lukasz.langa | create | |
|