Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Deprecate `push!(a, k, v)` in favor of `push!(a, k=>v)` because the old
signature was inconsistent with the varargs version of `push!` to add
multiple elements to a collection.

TODO: Add tests

Conflicts:
	base/deprecated.jl
  • Loading branch information
ivarne authored and bicycle1885 committed Jan 24, 2015
1 parent 4ff8145 commit e725653
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,6 @@ const base64 = base64encode

@deprecate map!(f::Callable, dest::StridedArray, A::StridedArray, B::Number) broadcast!(f, dest, A, B)
@deprecate map!(f::Callable, dest::StridedArray, A::Number, B::StridedArray) broadcast!(f, dest, A, B)

#9295
@deprecate push!(t::Associative, key, v) setindex!(t, v, key)
2 changes: 1 addition & 1 deletion base/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ end
getindex(t::Associative, k1, k2, ks...) = getindex(t, tuple(k1,k2,ks...))
setindex!(t::Associative, v, k1, k2, ks...) = setindex!(t, v, tuple(k1,k2,ks...))

push!(t::Associative, key, v) = setindex!(t, v, key)
push!(t::Associative, p::Pair) = setindex!(t, p.second, p.first)

# hashing objects by identity

Expand Down

0 comments on commit e725653

Please sign in to comment.