Skip to content

Commit 791f93c

Browse files
tkfnalimilantimholy
authored
Apply suggestions from code review
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr> Co-authored-by: Tim Holy <tim.holy@gmail.com>
1 parent e1173cb commit 791f93c

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

base/reduce.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,9 @@ The return type is `Int` for signed integers of less than system word size, and
470470
`UInt` for unsigned integers of less than system word size. For all other
471471
arguments, a common return type is found to which all arguments are promoted.
472472
473-
The value returned for empty `itr` can be specified by `init` which must be the
474-
additive identity. It is unspecified whether `init` is used for non-empty
475-
collections.
473+
The value returned for empty `itr` can be specified by `init`. It must be
474+
the additive identity (i.e. zero) as it is unspecified whether `init` is used
475+
for non-empty collections.
476476
477477
!!! compat "Julia 1.6"
478478
Keyword argument `init` requires Julia 1.6 or later.
@@ -642,8 +642,9 @@ end
642642
maximum(f, itr; [init])
643643
644644
Returns the largest result of calling function `f` on each element of `itr`.
645-
If provided, `init` must be a neutral element for `max` that will be returned
646-
for empty collections.
645+
646+
If provided, `init` must be a neutral element for `max` (i.e. which is less
647+
than any other element) that will be returned for empty collections.
647648
648649
!!! compat "Julia 1.6"
649650
Keyword argument `init` requires Julia 1.6 or later.

base/reflection.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,9 +1218,9 @@ See also [`applicable`](@ref).
12181218
julia> hasmethod(length, Tuple{Array})
12191219
true
12201220
1221-
julia> f(; orange) = orange;
1221+
julia> f(; oranges=0) = oranges;
12221222
1223-
julia> hasmethod(f, Tuple{}, (:orange,))
1223+
julia> hasmethod(f, Tuple{}, (:oranges,))
12241224
true
12251225
12261226
julia> hasmethod(f, Tuple{}, (:apples, :bananas))

0 commit comments

Comments
 (0)