Rob Cliffe wrote:
> I was surprised to find that in configparser, getboolean() does not raise
> KeyError for a non-existent config parameter.
> Is there a good reason for this?
History and backwards compatibility. The configparser module has some years on
it.
The rationale for this sort of thi
I was surprised to find that in configparser, getboolean() does not
raise KeyError for a non-existent config parameter.
Demo program (Python 3.11.5, Windows 11):
import configparser
config = configparser.ConfigParser()
config.read('ThisFileDoesNotExist.ini') # This line could be removed
MY_BOOL