Is it bad practice to use a ConfigParser within class methods? Doing this would mean the class is then tied to the config and not as easily re-usable, but means less input arguments in methods, which I would find messy especially if arguments had to be passed down multiple layers.
Are there good alternatives (apart from just passing config values as method arguments)? Or a particular pattern people find works well for this?
For example
# get shared config parser configured by main script
from utils.config_utils import config_parser
class FooClass(object):
def foo_method(self):
self._foo_bar_method()
def _foo_bar_method(self):
some_property = config_parser.get("root", "FooProperty")
....