Skip to content

Commit 1b86c36

Browse files
pabloferzJeffBezanson
authored andcommitted
Deprecate bitbroadcast (#19771)
* Deprecate `bitbroadcast` * Remove `bitbroadcast` docs
1 parent a8a5ad0 commit 1b86c36

File tree

5 files changed

+6
-24
lines changed

5 files changed

+6
-24
lines changed

base/broadcast.jl

+1-20
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ using Base: promote_eltype_op, linearindices, tail, OneTo, to_shape,
77
_msk_end, unsafe_bitgetindex, bitcache_chunks, bitcache_size, dumpbitcache,
88
nullable_returntype, null_safe_eltype_op, hasvalue, is_nullable_array
99
import Base: broadcast, broadcast!
10-
export bitbroadcast, dotview
11-
export broadcast_getindex, broadcast_setindex!
10+
export broadcast_getindex, broadcast_setindex!, dotview
1211

1312
## Broadcasting utilities ##
1413
# fallbacks for some special cases
@@ -453,24 +452,6 @@ julia> Ref(7) .+ Nullable(3)
453452
"""
454453
@inline broadcast(f, A, Bs...) = broadcast_c(f, containertype(A, Bs...), A, Bs...)
455454

456-
"""
457-
bitbroadcast(f, As...)
458-
459-
Like [`broadcast`](@ref), but allocates a `BitArray` to store the
460-
result, rather then an `Array`.
461-
462-
```jldoctest
463-
julia> bitbroadcast(isodd,[1,2,3,4,5])
464-
5-element BitArray{1}:
465-
true
466-
false
467-
true
468-
false
469-
true
470-
```
471-
"""
472-
@inline bitbroadcast(f, As...) = broadcast!(f, similar(BitArray, broadcast_indices(As...)), As...)
473-
474455
"""
475456
broadcast_getindex(A, inds...)
476457

base/deprecated.jl

+3
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,9 @@ function quadgk(args...; kwargs...)
13461346
end
13471347
export quadgk
13481348

1349+
# Broadcast now returns a BitArray when the resulting eltype is Bool (#17623)
1350+
@deprecate bitbroadcast broadcast
1351+
13491352
# Deprecate two-argument map! (map!(f, A)) for a cycle in anticipation of semantic change
13501353
@deprecate map!{F}(f::F, A::AbstractArray) map!(f, A, A)
13511354
@deprecate asyncmap!(f, c; ntasks=0, batch_size=nothing) asyncmap!(f, c, c; ntasks=ntasks, batch_size=batch_size)

base/exports.jl

-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ export
463463
zeta,
464464

465465
# arrays
466-
bitbroadcast,
467466
broadcast!,
468467
broadcast,
469468
broadcast_getindex,

doc/src/stdlib/arrays.md

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ All mathematical operations and functions are supported for arrays
4848
```@docs
4949
Base.broadcast
5050
Base.Broadcast.broadcast!
51-
Base.Broadcast.bitbroadcast
5251
```
5352

5453
## Indexing, Assignment, and Concatenation

test/bitarray.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1136,8 +1136,8 @@ let b1 = trues(v1), b2 = falses(v1)
11361136
end
11371137
end
11381138

1139-
let odds = bitbroadcast(isodd, 1:2000)
1140-
evens = bitbroadcast(iseven, 1:2000)
1139+
let odds = broadcast(isodd, 1:2000)
1140+
evens = broadcast(iseven, 1:2000)
11411141
for i = 1:2:2000
11421142
@test findprev(odds,i) == findprevnot(evens,i) == i
11431143
@test findnext(odds,i) == findnextnot(evens,i) == i

0 commit comments

Comments
 (0)