-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Support comparison between all Period subtypes #21378
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
Conversation
|
thanks. could use non-methoderror tests of something this allows that doesn't work yet on master |
|
Maybe it would work better to have |
|
|
base/dates/periods.jl
Outdated
|
|
||
| # disallow comparing fixed to other periods | ||
| (==){T<:FixedPeriod, S<:OtherPeriod}(x::T, y::S) = throw(MethodError(==, (T, S))) | ||
| (==){T<:OtherPeriod, S<:FixedPeriod}(x::T, y::S) = throw(MethodError(==, (T, S))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MethodError should contain the arguments, not their types (when possible).
|
Ah, I see. But by allowing |
|
Currently Base does always treats a |
|
Needs a rebase, then I guess we should merge this. |
|
Rebased and squashed commits. |
Allows user defined Period subtype to be compared against other Period subtypes.
See TimeZones.jl comment