Skip to content

Commit 3034fc5

Browse files
mergewith: add single argument example to docstring (#55964)
I ran into this edge case. I though it should be documented. --------- Co-authored-by: Lilith Orion Hafner <[email protected]>
1 parent d19bb47 commit 3034fc5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

base/abstractdict.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ Dict{String, Float64} with 3 entries:
392392
393393
julia> ans == mergewith(+)(a, b)
394394
true
395+
396+
julia> mergewith(-, Dict(), Dict(:a=>1)) # Combining function only used if key is present in both
397+
Dict{Any, Any} with 1 entry:
398+
:a => 1
395399
```
396400
"""
397401
mergewith(combine, d::AbstractDict, others::AbstractDict...) =

0 commit comments

Comments
 (0)