13.4 Using a class as a namespace for configuration
Python offers a variety of ways to package application inputs and configuration files. We’ll continue to look at writing files in Python notation because it’s elegant and the familiar syntax can lead to easy-to-read configuration files. A number of projects allow us to use a class definition to provide configuration parameters. This uses Python syntax, of course. It also uses the class definition as a namespace to allow multiple configurations to be provided in a single module. The use of a class hierarchy means that inheritance techniques can be used to simplify the organization of parameters.
This avoids the use of a ChainMap to permit user-specific overrides of generic settings. Instead, this uses ordinary inheritance.
We’re never going to create instances of these classes. We’re going to use the attributes of the class definition and rely on class inheritance methods to track...