-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
problem with utc.localize #413
Comments
My guess is that you are using an advanced enough version of Python that it provides its own Even when using the It does seem unfortunate that a method should appear or disappear based on Python version and based on whether
— with:
Does that make sense? I think it would have prevented you from writing code that called |
Joern proposed a change on our site based on your idea This will go into our next minor release. We should get off using the non standard localize method, may be a deprecation warning should help users to change their lines too. |
That’s an interesting idea! But a deprecation warning for folks upgrading to recent versions of Python 3 would require Skyfield to subclass the native Python Another approach would be to switch the logic: instead of having the default and fallback in the order With so many options, let’s gather my thoughts:
So I wanted the answer here to be, “the documentation never illustrated But I think that instead I should abandon my wild dreams of simplification, and pivot Skyfield to being as completely uniform for its users as possible: abandon the conditional imports and just always use its own built-in There is only one possible problem: What if folks using |
In the commit referenced above I attempt to make the situation more uniform by always returning either an official UTC object or else Skyfield’s own replacement for it. Skyfield no longer imports an entire 3rd-party module simply to use a single few-line object from it! This also means that Skyfield Hopefully this will make all code that relies on Skyfield entirely stable forever, with respect to how |
I used the conda package, so I'm not sure if there is a mistake or it is in the origin. Just asking ;)
just seen that in 1.24 I can't
in 1.23 this utc.localize can be used.
At now I can only say I miss it, if it is gone how have I to replace it?
The text was updated successfully, but these errors were encountered: