Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement __repr__ for manager.Configuration object #9

Closed
lundybernard opened this issue Apr 27, 2022 · 0 comments · Fixed by #30
Closed

implement __repr__ for manager.Configuration object #9

lundybernard opened this issue Apr 27, 2022 · 0 comments · Fixed by #30
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@lundybernard
Copy link
Owner

provide a helpful string representation of the Configuration object

Since repr should be used for debugging and unambiguous, it should display all the sources, and all of the attribute: value pairs that we know of from those sources. This can probably be accomplished fairly easily by printing the dict values of the configuration and sources recursively

ex:

<batconf.manager.Configuration object at 0x7f2c3e68e8f0>: {
    _config_class: '__main__.GlobalConfig'
    _config_sources: [
         <batconf.sources.dataclass.DataclassConfig at 0x7f2c3e68cfa0>: {
             '_root': '__main__',
             '_data': {
                 'key': 'value', 
                 'key2': None
             }
        },
    ]
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants