jbasko / configmanager

Forget about configparser, YAML, or JSON parsers. Focus on configuration. NOT RECOMMENDED FOR USE (2019-01-26)
MIT License
17 stars 5 forks source link

Treat @-prefixed names in config declarations as meta information #125

Closed jbasko closed 7 years ago

jbasko commented 7 years ago
config = Config({
    'enabled': {
        '@default': 'Hey!',
    },
    'db': {
        '@type': dict,  # and 'dict' should work too!
        '@default': {
            'user': ...
        }
    }
})

What about adding meta information to sections?

config = Config({'db': {'user': 'root', 'password': 'root', '@item_cls': DbConfigItem})