Skip to content

Commit 70c873e

Browse files
Returns -> Return (#47341)
* Returns -> Return n many docstrings and comments, to follow the general recommendation for how docstrings should be phrases. Co-authored-by: Fredrik Ekre <[email protected]>
1 parent 2ebe577 commit 70c873e

File tree

26 files changed

+60
-60
lines changed

26 files changed

+60
-60
lines changed

base/abstractarray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2882,7 +2882,7 @@ end
28822882
"""
28832883
isless(A::AbstractVector, B::AbstractVector)
28842884
2885-
Returns true when `A` is less than `B` in lexicographic order.
2885+
Return `true` when `A` is less than `B` in lexicographic order.
28862886
"""
28872887
isless(A::AbstractVector, B::AbstractVector) = cmp(A, B) < 0
28882888

base/asyncevent.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Waits until `testcb()` returns `true` or `timeout` seconds have passed, whicheve
306306
The test function is polled every `pollint` seconds. The minimum value for `pollint` is 0.001 seconds,
307307
that is, 1 millisecond.
308308
309-
Returns :ok or :timed_out
309+
Return `:ok` or `:timed_out`.
310310
"""
311311
function timedwait(testcb, timeout::Real; pollint::Real=0.1)
312312
pollint >= 1e-3 || throw(ArgumentError("pollint must be ≥ 1 millisecond"))

base/intfuncs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ end
904904
"""
905905
hastypemax(T::Type) -> Bool
906906
907-
Return true if and only if the extrema `typemax(T)` and `typemin(T)` are defined.
907+
Return `true` if and only if the extrema `typemax(T)` and `typemin(T)` are defined.
908908
"""
909909
hastypemax(::Base.BitIntegerType) = true
910910
hastypemax(::Type{Bool}) = true

base/logging.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function handle_message end
4242
"""
4343
shouldlog(logger, level, _module, group, id)
4444
45-
Return true when `logger` accepts a message at `level`, generated for
45+
Return `true` when `logger` accepts a message at `level`, generated for
4646
`_module`, `group` and with unique log identifier `id`.
4747
"""
4848
function shouldlog end
@@ -58,7 +58,7 @@ function min_enabled_level end
5858
"""
5959
catch_exceptions(logger)
6060
61-
Return true if the logger should catch exceptions which happen during log
61+
Return `true` if the logger should catch exceptions which happen during log
6262
record construction. By default, messages are caught
6363
6464
By default all exceptions are caught to prevent log message generation from

base/meta.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ quot(ex) = Expr(:quote, ex)
4848
"""
4949
Meta.isexpr(ex, head[, n])::Bool
5050
51-
Return true if `ex` is an `Expr` with the given type `head` and optionally that
51+
Return `true` if `ex` is an `Expr` with the given type `head` and optionally that
5252
the argument list is of length `n`. `head` may be a `Symbol` or collection of
5353
`Symbol`s. For example, to check that a macro was passed a function call
5454
expression, you might use `isexpr(ex, :call)`.

base/methodshow.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ functionloc(m::Core.MethodInstance) = functionloc(m.def)
160160
"""
161161
functionloc(m::Method)
162162
163-
Returns a tuple `(filename,line)` giving the location of a `Method` definition.
163+
Return a tuple `(filename,line)` giving the location of a `Method` definition.
164164
"""
165165
function functionloc(m::Method)
166166
file, ln = updated_methodloc(m)
@@ -173,7 +173,7 @@ end
173173
"""
174174
functionloc(f::Function, types)
175175
176-
Returns a tuple `(filename,line)` giving the location of a generic `Function` definition.
176+
Return a tuple `(filename,line)` giving the location of a generic `Function` definition.
177177
"""
178178
functionloc(@nospecialize(f), @nospecialize(types)) = functionloc(which(f,types))
179179

base/multimedia.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ print(io::IO, ::MIME{mime}) where {mime} = print(io, mime)
5757
"""
5858
showable(mime, x)
5959
60-
Returns a boolean value indicating whether or not the object `x` can be written
60+
Return a boolean value indicating whether or not the object `x` can be written
6161
as the given `mime` type.
6262
6363
(By default, this is determined automatically by the existence of the
@@ -125,7 +125,7 @@ show(io::IO, m::AbstractString, x) = show(io, MIME(m), x)
125125
"""
126126
repr(mime, x; context=nothing)
127127
128-
Returns an `AbstractString` or `Vector{UInt8}` containing the representation of
128+
Return an `AbstractString` or `Vector{UInt8}` containing the representation of
129129
`x` in the requested `mime` type, as written by [`show(io, mime, x)`](@ref) (throwing a
130130
[`MethodError`](@ref) if no appropriate `show` is available). An `AbstractString` is
131131
returned for MIME types with textual representations (such as `"text/html"` or
@@ -232,7 +232,7 @@ display(mime::AbstractString, @nospecialize x) = display(MIME(mime), x)
232232
displayable(mime) -> Bool
233233
displayable(d::AbstractDisplay, mime) -> Bool
234234
235-
Returns a boolean value indicating whether the given `mime` type (string) is displayable by
235+
Return a boolean value indicating whether the given `mime` type (string) is displayable by
236236
any of the displays in the current display stack, or specifically by the display `d` in the
237237
second variant.
238238
"""
@@ -244,7 +244,7 @@ displayable(mime::AbstractString) = displayable(MIME(mime))
244244
"""
245245
TextDisplay(io::IO)
246246
247-
Returns a `TextDisplay <: AbstractDisplay`, which displays any object as the text/plain MIME type
247+
Return a `TextDisplay <: AbstractDisplay`, which displays any object as the text/plain MIME type
248248
(by default), writing the text representation to the given I/O stream. (This is how
249249
objects are printed in the Julia REPL.)
250250
"""

base/number.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ copy(x::Number) = x # some code treats numbers as collection-like
115115
"""
116116
signbit(x)
117117
118-
Returns `true` if the value of the sign of `x` is negative, otherwise `false`.
118+
Return `true` if the value of the sign of `x` is negative, otherwise `false`.
119119
120120
See also [`sign`](@ref) and [`copysign`](@ref).
121121
@@ -352,7 +352,7 @@ one(x::T) where {T<:Number} = one(T)
352352
oneunit(x::T)
353353
oneunit(T::Type)
354354
355-
Returns `T(one(x))`, where `T` is either the type of the argument or
355+
Return `T(one(x))`, where `T` is either the type of the argument or
356356
(if a type is passed) the argument. This differs from [`one`](@ref) for
357357
dimensionful quantities: `one` is dimensionless (a multiplicative identity)
358358
while `oneunit` is dimensionful (of the same type as `x`, or of type `T`).

base/reduce.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ sum(f, a; kw...) = mapreduce(f, add_sum, a; kw...)
530530
"""
531531
sum(itr; [init])
532532
533-
Returns the sum of all elements in a collection.
533+
Return the sum of all elements in a collection.
534534
535535
The return type is `Int` for signed integers of less than system word size, and
536536
`UInt` for unsigned integers of less than system word size. For all other
@@ -562,7 +562,7 @@ sum(a::AbstractArray{Bool}; kw...) =
562562
"""
563563
prod(f, itr; [init])
564564
565-
Returns the product of `f` applied to each element of `itr`.
565+
Return the product of `f` applied to each element of `itr`.
566566
567567
The return type is `Int` for signed integers of less than system word size, and
568568
`UInt` for unsigned integers of less than system word size. For all other
@@ -586,7 +586,7 @@ prod(f, a; kw...) = mapreduce(f, mul_prod, a; kw...)
586586
"""
587587
prod(itr; [init])
588588
589-
Returns the product of all elements of a collection.
589+
Return the product of all elements of a collection.
590590
591591
The return type is `Int` for signed integers of less than system word size, and
592592
`UInt` for unsigned integers of less than system word size. For all other
@@ -673,7 +673,7 @@ end
673673
"""
674674
maximum(f, itr; [init])
675675
676-
Returns the largest result of calling function `f` on each element of `itr`.
676+
Return the largest result of calling function `f` on each element of `itr`.
677677
678678
The value returned for empty `itr` can be specified by `init`. It must be
679679
a neutral element for `max` (i.e. which is less than or equal to any
@@ -700,7 +700,7 @@ maximum(f, a; kw...) = mapreduce(f, max, a; kw...)
700700
"""
701701
minimum(f, itr; [init])
702702
703-
Returns the smallest result of calling function `f` on each element of `itr`.
703+
Return the smallest result of calling function `f` on each element of `itr`.
704704
705705
The value returned for empty `itr` can be specified by `init`. It must be
706706
a neutral element for `min` (i.e. which is greater than or equal to any
@@ -727,7 +727,7 @@ minimum(f, a; kw...) = mapreduce(f, min, a; kw...)
727727
"""
728728
maximum(itr; [init])
729729
730-
Returns the largest element in a collection.
730+
Return the largest element in a collection.
731731
732732
The value returned for empty `itr` can be specified by `init`. It must be
733733
a neutral element for `max` (i.e. which is less than or equal to any
@@ -759,7 +759,7 @@ maximum(a; kw...) = mapreduce(identity, max, a; kw...)
759759
"""
760760
minimum(itr; [init])
761761
762-
Returns the smallest element in a collection.
762+
Return the smallest element in a collection.
763763
764764
The value returned for empty `itr` can be specified by `init`. It must be
765765
a neutral element for `min` (i.e. which is greater than or equal to any
@@ -870,7 +870,7 @@ end
870870
"""
871871
findmax(f, domain) -> (f(x), index)
872872
873-
Returns a pair of a value in the codomain (outputs of `f`) and the index of
873+
Return a pair of a value in the codomain (outputs of `f`) and the index of
874874
the corresponding value in the `domain` (inputs to `f`) such that `f(x)` is maximised.
875875
If there are multiple maximal points, then the first one will be returned.
876876
@@ -929,7 +929,7 @@ _findmax(a, ::Colon) = findmax(identity, a)
929929
"""
930930
findmin(f, domain) -> (f(x), index)
931931
932-
Returns a pair of a value in the codomain (outputs of `f`) and the index of
932+
Return a pair of a value in the codomain (outputs of `f`) and the index of
933933
the corresponding value in the `domain` (inputs to `f`) such that `f(x)` is minimised.
934934
If there are multiple minimal points, then the first one will be returned.
935935

base/set.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ unique(r::AbstractRange) = allunique(r) ? r : oftype(r, r[begin:begin])
210210
"""
211211
unique(f, itr)
212212
213-
Returns an array containing one value from `itr` for each unique value produced by `f`
213+
Return an array containing one value from `itr` for each unique value produced by `f`
214214
applied to elements of `itr`.
215215
216216
# Examples

0 commit comments

Comments
 (0)