I think the key issue being presented by Mariusz is that even if we ensure that CACHE_MIDDLEWARE_SECONDS
works well with lazy objects, we still could have the same “false positive check” issue with other settings…
Unless I’m missing something, I don’t see with clarity what our strategy would be to make the checks more restrictive and yet not “breaking” projects out there making “perhaps unorthodox” usage of settings.
While reading these posts (thank you for your effort and dedication so far!), I keep wondering two things:
- Whether we should (instead) consider a more radical approach and re-design settings. For example going the route that Carlton proposes with declarative settings.
- Whether there are other framework/tools out there that provide this functionality (typed configs/settings) so we don’t re-invent the wheel. In the past I did work with a “typed config parser”[0] that is currently unmaintained, and I see at least one other library providing this concept[1], though is quite unclear we would like to go down this path.
Now, in my personal opinion, the current settings, while not perfect, are reasonably good, and it’s unclear to me whether efforts in this area are worth the time investment, particularly given the likely pushback we’d get from users doing custom things around them.
[0] configglue | Read the Docs
[1] GitHub - ajatkj/typed_configparser: A fully typed configparser built on top of configparser