-
Notifications
You must be signed in to change notification settings - Fork 5
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
Defaults/Overrides auto-loading - necessary? #18
Comments
Have to read the code again to answer precisely to your questions and find a proper solution to the problem you're pointing, which, by the way sounds completly relevant to me. However about the questions you asked:
Let me know what you think ! |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to use etcaetera in a "case sensitive" manner where the incoming config sources (files etc) are not forced into upper- or lowercase but simply retain the literal values.
(There's no hard requirement for this on my end [yet], but it feels like the sane default to me. If a user decided they wanted a
SillyCapsName
key in their config file, my tool automatically changing it toSILLYCAPSNAME
orsillycapsname
feels like a nasty surprise :()I tried to do
Config(formatter=noop)
(where:def noop(s): return s
) to implement this, and found that theDefaults
andOverrides
adapters gum it up by callingself.load()
in their__init__
- so their defaultuppercase
formatters execute before the central one defined onConfig
gets a chance to (by which time the "real" key data has been lost).End result is that I presently need to override
formatter=
in multiple places instead of justConfig
. Not a deal killer, but inelegant and not DRY :)This brings me to my actual questions:
noop
(preferable), or havingDefaults
andOverrides
cease auto-loading? I'm willing to make a PR if necessary.The text was updated successfully, but these errors were encountered: