-
Notifications
You must be signed in to change notification settings - Fork 2
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
Resolving constants milestone issues and constants bundling. #364
Comments
I was following the argument well until I got here:
How is that possibility open? Core constants will be defined using Did I miss anything? |
Not all core constants are necessarily defined using
I think the more compelling argument is that it is just needless duplication. |
As we all know, in Python, if a user want to change something, there's absolutely nothing that can prevent that. But beyond certain reasonable cases, if a user changes something they should not and that results in useless results, to be honest, they deserve it. On your last point, needless duplication does not sound too compelling to me if you sacrifice simplicity. For me needless duplication is having to keep two separate sets of constants. That makes the interface more complicated - not super complicated, just a bit more complicated. If the risk of having inconsistent set of constants is as small as you suggest, I honestly would go for the |
I agree about users deserving what they get in those cases 😄 I think there is a cost to simplicity in what we would need to do to Beyond the handling of core constants, though, the approach for the meta constants seems sound? |
Yes, that looked sensible, considering the problem to solve. I guess one potential difficulty might be finding the common constants that should go in the Meta model, but maybe I'm seeing a problem where there is none. |
This is a cross between a meta-issue and a discussion to tidy up a backlog of constants questions that we've grouped in the "Constants system" milestone.
This issue is also a summary of the inaugural monthly "GitHub issues" developer meetings to bundle existing issues and clean them up 🎉 🥂
Where we are now
CoreConstants
andModelSpecificConstants
and whether it might be easier to merge core constants into each model constants to provide a simpler namespace (see Include core constants as an attribute of each model constants class #342).Outstanding issues
We have five outstanding constants issues:
The remaining two issues are linked and this PR suggests a resolution for both:
Sharing constants and functionality
The proposed solution to #358 that we can define model "meta" constants classes and use class inheritance to allow the clean use of different constants classes with shared functions. So:
These can then be used seamlessly in both models - all of the statements below are
mypy
friendly because the typing ofModelMeta
supports the meta class itself and any derived model specific subclasses.Merging core constants into models - we could but no
That solution also opens up this resolution for #342 - which seems really clean and avoids the whole issue with properties that was mentioned on this topic in #341.
And hence:
However, the dev meeting concluded:
Config
, but we should simply create one instance at startup and share it through the model signature somehow. We could addcore_constants
to the ABC signature.So - we should simply close #342 and live with having two constants classes.
The text was updated successfully, but these errors were encountered: