diff --git a/HISTORY.md b/HISTORY.md index 881b0e6797241..6a720cae33032 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -212,6 +212,7 @@ New library functions * Added `Base.hasproperty` and `Base.hasfield` ([#28850]). * One argument `!=(x)`, `>(x)`, `>=(x)`, `<(x)`, `<=(x)` have been added, returning partially-applied versions of the functions, similar to the existing `==(x)` and `isequal(x)` methods ([#30915]). +* The new `map!(f, values(::AbstractDict))` method allows to modify in-place values of a dictionary ([#31223]). Standard library changes ------------------------ diff --git a/base/abstractdict.jl b/base/abstractdict.jl index 94fb94de2315e..856b4156d846f 100644 --- a/base/abstractdict.jl +++ b/base/abstractdict.jl @@ -713,6 +713,9 @@ Modifies `dict` by transforming each value from `val` to `f(val)`. Note that the type of `dict` cannot be changed: if `f(val)` is not an instance of the value type of `dict` then it will be converted to the value type if possible and otherwise raise an error. +!!! compat "Julia 1.2" + `map!(f, values(dict::AbstractDict))` requires Julia 1.2 or later. + # Examples ```jldoctest julia> d = Dict(:a => 1, :b => 2)