-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
(Friday + March) / April === 2.0
#51357
Comments
This is because none of the months have a proper type - they are literally numeric constants as magical numbers: julia/stdlib/Dates/src/query.jl Lines 259 to 270 in e708c5e
|
I can't think of any languages that have months and weeks be treated as integers by default. |
Presumably they should be |
It could be useful for iterating over a range of months, for example |
That can easily be accomodated by another approach as well. Ranges are not exclusive to numbers; |
I don't think fixing this has to be breaking. Although looking at it a bit more, it seems that returning integers for months (e.g. in the |
How about making Dates an upgradeable stdlib? I mean, this kinda misses the point a little as users have to opt in when the problematic constants are already defined. |
I don't think this can be considered a bug --- Dates exports these constants and the design, clearly, was to make them just integers. You can certainly disagree with that design but changing it now would cause bugs. |
Right - hence the requirement to do this in a major version bump of the stdlib (which need not coincide with a major version bump of Julia, if I'm not mistaken). |
A bit depressing that #19210 has been open for numerous breaking releases now 😬 |
Dates could be moved to an upgradable stdlib and there could be a breaking version made there maybe? |
The only potential problem I see with upgradeable stdlibs is backporting bugfixes and maintaining the non-breaking Dates package. Would everyone who just uses Julia 1.X without touching Dates be left bugfixless? |
Has seen Dates that much movement/fixes in the past that this is a concern? Most Dates stuff seems recent and about the core design of the package, not just related to easily fixable bugs. |
This is too permissive.
The text was updated successfully, but these errors were encountered: