Skip to content

Commit 25a05f0

Browse files
rfourquetStefanKarpinski
authored andcommitted
update push! & append! docstrings (wrt orderedness) (#28912)
1 parent fcf9063 commit 25a05f0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

base/array.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@ _deleteat!(a::Vector, i::Integer, delta::Integer) =
841841
"""
842842
push!(collection, items...) -> collection
843843
844-
Insert one or more `items` at the end of `collection`.
844+
Insert one or more `items` in `collection`. If `collection` is an ordered container,
845+
the items are inserted at the end (in the given order).
845846
846847
# Examples
847848
```jldoctest
@@ -855,9 +856,9 @@ julia> push!([1, 2, 3], 4, 5, 6)
855856
6
856857
```
857858
858-
Use [`append!`](@ref) to add all the elements of another collection to
859-
`collection`. The result of the preceding example is equivalent to `append!([1, 2, 3], [4,
860-
5, 6])`.
859+
If `collection` is ordered, use [`append!`](@ref) to add all the elements of another
860+
collection to it. The result of the preceding example is equivalent to `append!([1, 2, 3], [4,
861+
5, 6])`. For `AbstractSet` objects, [`union!`](@ref) can be used instead.
861862
"""
862863
function push! end
863864

@@ -878,7 +879,7 @@ end
878879
"""
879880
append!(collection, collection2) -> collection.
880881
881-
Add the elements of `collection2` to the end of `collection`.
882+
For an ordered container `collection`, add the elements of `collection2` to the end of it.
882883
883884
# Examples
884885
```jldoctest

0 commit comments

Comments
 (0)