Skip to content

Commit ffc3974

Browse files
authored
add compat annotations for replace on tuples (#41746)
The methods were added in #38216. (cherry-picked from 57ce0e6, PR #41701)
1 parent 712b801 commit ffc3974

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Standard library changes
148148
overflow in most cases. The new function `checked_length` is now available, which will try to use checked
149149
arithmetic to error if the result may be wrapping. Or use a package such as SaferIntegers.jl when
150150
constructing the range. ([#40382])
151+
* New `replace` methods to replace elements of a `Tuple` ([#38216]).
151152

152153
#### Package Manager
153154

@@ -316,6 +317,7 @@ Tooling Improvements
316317
[#37971]: https://github.com/JuliaLang/julia/issues/37971
317318
[#37978]: https://github.com/JuliaLang/julia/issues/37978
318319
[#38041]: https://github.com/JuliaLang/julia/issues/38041
320+
[#38216]: https://github.com/JuliaLang/julia/issues/38216
319321
[#38379]: https://github.com/JuliaLang/julia/issues/38379
320322
[#38438]: https://github.com/JuliaLang/julia/issues/38438
321323
[#38574]: https://github.com/JuliaLang/julia/issues/38574

base/set.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@ replaced.
548548
549549
See also [`replace!`](@ref), [`splice!`](@ref), [`delete!`](@ref), [`insert!`](@ref).
550550
551+
!!! compat "Julia 1.7"
552+
Version 1.7 is required to replace elements of a `Tuple`.
553+
551554
# Examples
552555
```jldoctest
553556
julia> replace([1, 2, 1, 3], 1=>0, 2=>4, count=2)
@@ -596,6 +599,9 @@ Return a copy of `A` where each value `x` in `A` is replaced by `new(x)`.
596599
If `count` is specified, then replace at most `count` values in total
597600
(replacements being defined as `new(x) !== x`).
598601
602+
!!! compat "Julia 1.7"
603+
Version 1.7 is required to replace elements of a `Tuple`.
604+
599605
# Examples
600606
```jldoctest
601607
julia> replace(x -> isodd(x) ? 2x : x, [1, 2, 3, 4])

0 commit comments

Comments
 (0)