hamilton
hamilton copied to clipboard
Lazy config evaluation
[Short description explaining the high-level reason for the pull request]
Additions
Removals
Changes
Testing
Screenshots
If applicable
Notes
Todos
Checklist
- [ ] PR has an informative and human-readable title
- [ ] Changes are limited to a single goal (no scope creep)
- [ ] Code can be automatically merged (no conflicts)
- [ ] Code follows the standards laid out in the TODO link to standards
- [ ] Passes all existing automated tests
- [ ] Any change in functionality is tested
- [ ] New functions are documented (with a description, list of inputs, and expected output)
- [ ] Placeholder code is flagged / future todos are captured in comments
- [ ] Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
- [ ] Reviewers requested with the Reviewers tool :arrow_right:
Testing checklist
Python
- [ ] python 3.6
- [ ] python 3.7
Need to add tests/figure out what to test. Hopefully this demonstrates the issue. IMO chainmap is actually better here -- supporting a lazyconfig is reasonable. That said, I'd prefer the simplicity with a dictionary.
Pros of this:
- It allows lazily evaluated configs
- Its idiomatic -- types are only as constricted as they need to be (E.G. why does config have to be a dict?)
- It solves the problem a customer has
Cons of this:
- We can do less with the config/inputs - E.G. if we want to store them somewhere or print them out we'll be running up against the same problem.
- Added complexity for a specific use-case