-
-
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
#34518 - rename isimmutable to ismutable #34652
Changes from 1 commit
8faa424
6b76c59
a77d03a
ca4d104
a252f5e
eed8b67
28f7f9f
aba863f
dc724e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -642,6 +642,7 @@ export | |
isbits, | ||
isequal, | ||
isimmutable, | ||
ismutable, | ||
isless, | ||
ifelse, | ||
objectid, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -417,7 +417,28 @@ julia> isimmutable([1,2]) | |
false | ||
``` | ||
""" | ||
isimmutable(@nospecialize(x)) = (@_pure_meta; !typeof(x).mutable) | ||
function isimmutable(@nospecialize(x)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We generally don't start introducing "live" depwarns of exported functions in the middle of a stable release. Instead you should move this to the end of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok! moved |
||
depwarn(" isimmutable is deprecated use ismutable instead ", :isimmutable) | ||
return (@_pure_meta; !typeof(x).mutable) | ||
end | ||
|
||
""" | ||
ismutable(v) -> Bool | ||
|
||
Return `true` iff value `v` is mutable. See [Mutable Composite Types](@ref) | ||
for a discussion of immutability. Note that this function works on values, so if you give it | ||
a type, it will tell you that a value of `DataType` is mutable. | ||
|
||
# Examples | ||
```jldoctest | ||
julia> ismutable(1) | ||
false | ||
|
||
julia> ismutable([1,2]) | ||
true | ||
``` | ||
""" | ||
ismutable(@nospecialize(x)) = (@_pure_meta; typeof(x).mutable) | ||
|
||
""" | ||
isstructtype(T) -> Bool | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,6 +159,7 @@ Base.isdispatchtuple | |
|
||
```@docs | ||
Base.isimmutable | ||
Base.ismutable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe switch the order and put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. order switched in aba863f |
||
Base.isabstracttype | ||
Base.isprimitivetype | ||
Base.issingletontype | ||
|
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.
You could move this export to where the function is defined in
deprecated.jl
such that we don't forget to remove it once the function definition is removed (that has happened before).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.
export moved to
deprecated.jl
in 28f7f9f