-
Notifications
You must be signed in to change notification settings - Fork 14
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
Make it possible to use multiple calendar settings in the same app. #6
Comments
It is actually currently possible to do this using the |
I am probably at fault, since I mixed two different issues here.
|
That's true, we could redesign the API so that things like Do you know of any other Python libraries that allow you to change global variables? It would be interesting to compare my implementation to how others do it. I'm not opposed to changing it to what you propose, but I don't want to change it without a good reason, and I want to make sure I'm changing it in a way that will be stable and maintainable. |
I would suggest to completely avoid globals if possible. They do make it harder to test things etc. |
I could see some statistical forecasting products breaking with globals such as |
My current usecase does not fall in this category, but a relatively subtle implication of the current implementation is that it is not really possible to use different fiscal calendar settings in the same application. The problem is that as soon as you update the global settings, the behaviour of the existing objects changes too. For example:
Arguably, someone could claim that this is a feature too! :P
And in certain contexts, it probably is! Neverheless, it can also lead to subtle bugs and various errors when you do calculations. If nothing else, I think that there should be at least a warning in the docs.
PS. The older I get the more I like immutable objects :P
The text was updated successfully, but these errors were encountered: