Skip to content

Commit 414b5d8

Browse files
rfourquetKristofferC
authored andcommitted
add compat annotation for map!(f, values(dict)) (from #31223) (#35184)
(cherry picked from commit 6447534)
1 parent 1b9d8ac commit 414b5d8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ New library functions
212212
* Added `Base.hasproperty` and `Base.hasfield` ([#28850]).
213213
* One argument `!=(x)`, `>(x)`, `>=(x)`, `<(x)`, `<=(x)` have been added, returning partially-applied
214214
versions of the functions, similar to the existing `==(x)` and `isequal(x)` methods ([#30915]).
215+
* The new `map!(f, values(::AbstractDict))` method allows to modify in-place values of a dictionary ([#31223]).
215216

216217
Standard library changes
217218
------------------------

base/abstractdict.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,9 @@ Modifies `dict` by transforming each value from `val` to `f(val)`.
713713
Note that the type of `dict` cannot be changed: if `f(val)` is not an instance of the value type
714714
of `dict` then it will be converted to the value type if possible and otherwise raise an error.
715715
716+
!!! compat "Julia 1.2"
717+
`map!(f, values(dict::AbstractDict))` requires Julia 1.2 or later.
718+
716719
# Examples
717720
```jldoctest
718721
julia> d = Dict(:a => 1, :b => 2)

0 commit comments

Comments
 (0)