-
-
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
Add deprecation for equalto and occursin #26480
Conversation
59bc7af
to
d8ef718
Compare
I'd remove the NEWS — the context there is breaking changes from 0.6. I think that'd just be confusing for the vast majority of the audience. |
84b6fcf
to
e8f954c
Compare
@@ -1510,6 +1510,12 @@ end | |||
# Issue #26248 | |||
@deprecate conj(x) x | |||
|
|||
# PR #26436 | |||
@deprecate equalto(x) isequal(x) | |||
@deprecate(occursin(x), in(x)) |
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.
Why the parens?
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.
Otherwise it parses as occursin(x) in x
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.
d'oh!
base/deprecated.jl
Outdated
@deprecate equalto(x) isequal(x) | ||
@deprecate(occursin(x), in(x)) | ||
@deprecate_binding EqualTo Base.Fix2 false | ||
@deprecate_binding OccursIn Base.Fix2 false |
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.
I left in definitions for these actually:
const EqualTo = Fix2{typeof(isequal)}
const OccursIn = Fix2{typeof(in)}
I'm not sure what their ultimate fate will be but they're pretty harmless for now.
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 use of OccursIn
there will be kind of weird once the contains
-> occursin
replacement goes through though.
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.
Fair enough, but we have to do something. They can't both be deprecated just to Fix2
, since that won't work.
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.
Okay, I can just remove these deprecations and we can probably just silently remove EqualTo
and OccursIn
between 0.7 and 1.0. How does that sound?
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.
Why not just do @deprecate_binding EqualTo Base.Fix2{typeof(isequal)} false
? That seems to work.
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.
Do we want to make the internal definitions use <:Union{typeof(isequal), typeof(==)}
?
Also deprecate the unexported EqualTo and OccursIn aliases (which were previously types before 26436).
e8f954c
to
71ab218
Compare
These were removed in #26436 without deprecation, so this PR adds a deprecation for them
plus a NEWS item. It also addresses #26436 (comment).