From ec0d730046c0c5759696fb03e473d47fad05f17e Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Mon, 5 Oct 2020 22:50:09 +0200 Subject: [PATCH] add NEWS and compat --- NEWS.md | 1 + base/reduce.jl | 3 +++ base/reducedim.jl | 3 +++ 3 files changed, 7 insertions(+) diff --git a/NEWS.md b/NEWS.md index 2b7c281a8df311..3354f68ef023c1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -85,6 +85,7 @@ New library features * New constructor `NamedTuple(iterator)` that constructs a named tuple from a key-value pair iterator. * A new `reinterpret(reshape, T, a::AbstractArray{S})` reinterprets `a` to have eltype `T` while potentially inserting or consuming the first dimension depending on the ratio of `sizeof(T)` and `sizeof(S)`. +* `count` now accepts an optional `init` argument to control the accumulation type ([#37461]). Standard library changes ------------------------ diff --git a/base/reduce.jl b/base/reduce.jl index 2159db19832c67..dd68cbf3ad62fc 100644 --- a/base/reduce.jl +++ b/base/reduce.jl @@ -944,6 +944,9 @@ Count the number of elements in `itr` for which the function `f` returns `true`. If `f` is omitted, counts the number of `true` elements in `itr` (which should be a collection of boolean values). +!!! compat "Julia 1.6" + `init` keyword was added in Julia 1.6. + # Examples ```jldoctest julia> count(i->(4<=i<=6), [2,3,4,5,6]) diff --git a/base/reducedim.jl b/base/reducedim.jl index dc48f59a2f8cdb..c83c2c71cb3e66 100644 --- a/base/reducedim.jl +++ b/base/reducedim.jl @@ -369,6 +369,9 @@ dimensions. !!! compat "Julia 1.5" `dims` keyword was added in Julia 1.5. +!!! compat "Julia 1.6" + `init` keyword was added in Julia 1.6. + # Examples ```jldoctest julia> A = [1 2; 3 4]