Skip to content

Commit

Permalink
Returns -> Return (#47341)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
fingolfin and fredrikekre committed Oct 27, 2022
1 parent 2ebe577 commit 70c873e
Show file tree
Hide file tree
Showing 26 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2882,7 +2882,7 @@ end
"""
isless(A::AbstractVector, B::AbstractVector)
Returns true when `A` is less than `B` in lexicographic order.
Return `true` when `A` is less than `B` in lexicographic order.
"""
isless(A::AbstractVector, B::AbstractVector) = cmp(A, B) < 0

Expand Down
2 changes: 1 addition & 1 deletion base/asyncevent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Waits until `testcb()` returns `true` or `timeout` seconds have passed, whicheve
The test function is polled every `pollint` seconds. The minimum value for `pollint` is 0.001 seconds,
that is, 1 millisecond.
Returns :ok or :timed_out
Return `:ok` or `:timed_out`.
"""
function timedwait(testcb, timeout::Real; pollint::Real=0.1)
pollint >= 1e-3 || throw(ArgumentError("pollint must be ≥ 1 millisecond"))
Expand Down
2 changes: 1 addition & 1 deletion base/intfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ end
"""
hastypemax(T::Type) -> Bool
Return true if and only if the extrema `typemax(T)` and `typemin(T)` are defined.
Return `true` if and only if the extrema `typemax(T)` and `typemin(T)` are defined.
"""
hastypemax(::Base.BitIntegerType) = true
hastypemax(::Type{Bool}) = true
Expand Down
4 changes: 2 additions & 2 deletions base/logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function handle_message end
"""
shouldlog(logger, level, _module, group, id)
Return true when `logger` accepts a message at `level`, generated for
Return `true` when `logger` accepts a message at `level`, generated for
`_module`, `group` and with unique log identifier `id`.
"""
function shouldlog end
Expand All @@ -58,7 +58,7 @@ function min_enabled_level end
"""
catch_exceptions(logger)
Return true if the logger should catch exceptions which happen during log
Return `true` if the logger should catch exceptions which happen during log
record construction. By default, messages are caught
By default all exceptions are caught to prevent log message generation from
Expand Down
2 changes: 1 addition & 1 deletion base/meta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ quot(ex) = Expr(:quote, ex)
"""
Meta.isexpr(ex, head[, n])::Bool
Return true if `ex` is an `Expr` with the given type `head` and optionally that
Return `true` if `ex` is an `Expr` with the given type `head` and optionally that
the argument list is of length `n`. `head` may be a `Symbol` or collection of
`Symbol`s. For example, to check that a macro was passed a function call
expression, you might use `isexpr(ex, :call)`.
Expand Down
4 changes: 2 additions & 2 deletions base/methodshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ functionloc(m::Core.MethodInstance) = functionloc(m.def)
"""
functionloc(m::Method)
Returns a tuple `(filename,line)` giving the location of a `Method` definition.
Return a tuple `(filename,line)` giving the location of a `Method` definition.
"""
function functionloc(m::Method)
file, ln = updated_methodloc(m)
Expand All @@ -173,7 +173,7 @@ end
"""
functionloc(f::Function, types)
Returns a tuple `(filename,line)` giving the location of a generic `Function` definition.
Return a tuple `(filename,line)` giving the location of a generic `Function` definition.
"""
functionloc(@nospecialize(f), @nospecialize(types)) = functionloc(which(f,types))

Expand Down
8 changes: 4 additions & 4 deletions base/multimedia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ print(io::IO, ::MIME{mime}) where {mime} = print(io, mime)
"""
showable(mime, x)
Returns a boolean value indicating whether or not the object `x` can be written
Return a boolean value indicating whether or not the object `x` can be written
as the given `mime` type.
(By default, this is determined automatically by the existence of the
Expand Down Expand Up @@ -125,7 +125,7 @@ show(io::IO, m::AbstractString, x) = show(io, MIME(m), x)
"""
repr(mime, x; context=nothing)
Returns an `AbstractString` or `Vector{UInt8}` containing the representation of
Return an `AbstractString` or `Vector{UInt8}` containing the representation of
`x` in the requested `mime` type, as written by [`show(io, mime, x)`](@ref) (throwing a
[`MethodError`](@ref) if no appropriate `show` is available). An `AbstractString` is
returned for MIME types with textual representations (such as `"text/html"` or
Expand Down Expand Up @@ -232,7 +232,7 @@ display(mime::AbstractString, @nospecialize x) = display(MIME(mime), x)
displayable(mime) -> Bool
displayable(d::AbstractDisplay, mime) -> Bool
Returns a boolean value indicating whether the given `mime` type (string) is displayable by
Return a boolean value indicating whether the given `mime` type (string) is displayable by
any of the displays in the current display stack, or specifically by the display `d` in the
second variant.
"""
Expand All @@ -244,7 +244,7 @@ displayable(mime::AbstractString) = displayable(MIME(mime))
"""
TextDisplay(io::IO)
Returns a `TextDisplay <: AbstractDisplay`, which displays any object as the text/plain MIME type
Return a `TextDisplay <: AbstractDisplay`, which displays any object as the text/plain MIME type
(by default), writing the text representation to the given I/O stream. (This is how
objects are printed in the Julia REPL.)
"""
Expand Down
4 changes: 2 additions & 2 deletions base/number.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ copy(x::Number) = x # some code treats numbers as collection-like
"""
signbit(x)
Returns `true` if the value of the sign of `x` is negative, otherwise `false`.
Return `true` if the value of the sign of `x` is negative, otherwise `false`.
See also [`sign`](@ref) and [`copysign`](@ref).
Expand Down Expand Up @@ -352,7 +352,7 @@ one(x::T) where {T<:Number} = one(T)
oneunit(x::T)
oneunit(T::Type)
Returns `T(one(x))`, where `T` is either the type of the argument or
Return `T(one(x))`, where `T` is either the type of the argument or
(if a type is passed) the argument. This differs from [`one`](@ref) for
dimensionful quantities: `one` is dimensionless (a multiplicative identity)
while `oneunit` is dimensionful (of the same type as `x`, or of type `T`).
Expand Down
18 changes: 9 additions & 9 deletions base/reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ sum(f, a; kw...) = mapreduce(f, add_sum, a; kw...)
"""
sum(itr; [init])
Returns the sum of all elements in a collection.
Return the sum of all elements in a collection.
The return type is `Int` for signed integers of less than system word size, and
`UInt` for unsigned integers of less than system word size. For all other
Expand Down Expand Up @@ -562,7 +562,7 @@ sum(a::AbstractArray{Bool}; kw...) =
"""
prod(f, itr; [init])
Returns the product of `f` applied to each element of `itr`.
Return the product of `f` applied to each element of `itr`.
The return type is `Int` for signed integers of less than system word size, and
`UInt` for unsigned integers of less than system word size. For all other
Expand All @@ -586,7 +586,7 @@ prod(f, a; kw...) = mapreduce(f, mul_prod, a; kw...)
"""
prod(itr; [init])
Returns the product of all elements of a collection.
Return the product of all elements of a collection.
The return type is `Int` for signed integers of less than system word size, and
`UInt` for unsigned integers of less than system word size. For all other
Expand Down Expand Up @@ -673,7 +673,7 @@ end
"""
maximum(f, itr; [init])
Returns the largest result of calling function `f` on each element of `itr`.
Return the largest result of calling function `f` on each element of `itr`.
The value returned for empty `itr` can be specified by `init`. It must be
a neutral element for `max` (i.e. which is less than or equal to any
Expand All @@ -700,7 +700,7 @@ maximum(f, a; kw...) = mapreduce(f, max, a; kw...)
"""
minimum(f, itr; [init])
Returns the smallest result of calling function `f` on each element of `itr`.
Return the smallest result of calling function `f` on each element of `itr`.
The value returned for empty `itr` can be specified by `init`. It must be
a neutral element for `min` (i.e. which is greater than or equal to any
Expand All @@ -727,7 +727,7 @@ minimum(f, a; kw...) = mapreduce(f, min, a; kw...)
"""
maximum(itr; [init])
Returns the largest element in a collection.
Return the largest element in a collection.
The value returned for empty `itr` can be specified by `init`. It must be
a neutral element for `max` (i.e. which is less than or equal to any
Expand Down Expand Up @@ -759,7 +759,7 @@ maximum(a; kw...) = mapreduce(identity, max, a; kw...)
"""
minimum(itr; [init])
Returns the smallest element in a collection.
Return the smallest element in a collection.
The value returned for empty `itr` can be specified by `init`. It must be
a neutral element for `min` (i.e. which is greater than or equal to any
Expand Down Expand Up @@ -870,7 +870,7 @@ end
"""
findmax(f, domain) -> (f(x), index)
Returns a pair of a value in the codomain (outputs of `f`) and the index of
Return a pair of a value in the codomain (outputs of `f`) and the index of
the corresponding value in the `domain` (inputs to `f`) such that `f(x)` is maximised.
If there are multiple maximal points, then the first one will be returned.
Expand Down Expand Up @@ -929,7 +929,7 @@ _findmax(a, ::Colon) = findmax(identity, a)
"""
findmin(f, domain) -> (f(x), index)
Returns a pair of a value in the codomain (outputs of `f`) and the index of
Return a pair of a value in the codomain (outputs of `f`) and the index of
the corresponding value in the `domain` (inputs to `f`) such that `f(x)` is minimised.
If there are multiple minimal points, then the first one will be returned.
Expand Down
2 changes: 1 addition & 1 deletion base/set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ unique(r::AbstractRange) = allunique(r) ? r : oftype(r, r[begin:begin])
"""
unique(f, itr)
Returns an array containing one value from `itr` for each unique value produced by `f`
Return an array containing one value from `itr` for each unique value produced by `f`
applied to elements of `itr`.
# Examples
Expand Down
6 changes: 3 additions & 3 deletions base/stacktraces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ end
"""
stacktrace([trace::Vector{Ptr{Cvoid}},] [c_funcs::Bool=false]) -> StackTrace
Returns a stack trace in the form of a vector of `StackFrame`s. (By default stacktrace
Return a stack trace in the form of a vector of `StackFrame`s. (By default stacktrace
doesn't return C functions, but this can be enabled.) When called without specifying a
trace, `stacktrace` first calls `backtrace`.
"""
Expand Down Expand Up @@ -200,7 +200,7 @@ end
"""
remove_frames!(stack::StackTrace, m::Module)
Returns the `StackTrace` with all `StackFrame`s from the provided `Module` removed.
Return the `StackTrace` with all `StackFrame`s from the provided `Module` removed.
"""
function remove_frames!(stack::StackTrace, m::Module)
filter!(f -> !from(f, m), stack)
Expand Down Expand Up @@ -287,7 +287,7 @@ end
"""
from(frame::StackFrame, filter_mod::Module) -> Bool
Returns whether the `frame` is from the provided `Module`
Return whether the `frame` is from the provided `Module`
"""
function from(frame::StackFrame, m::Module)
return parentmodule(frame) === m
Expand Down
2 changes: 1 addition & 1 deletion base/stat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ stat(fd::Integer) = stat(RawFD(fd))
"""
stat(file)
Returns a structure whose fields contain information about the file.
Return a structure whose fields contain information about the file.
The fields of the structure are:
| Name | Description |
Expand Down
4 changes: 2 additions & 2 deletions base/strings/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Base: show, ==, hash, string, Symbol, isless, length, eltype,
"""
isvalid(value) -> Bool
Returns `true` if the given value is valid for its type, which currently can be either
Return `true` if the given value is valid for its type, which currently can be either
`AbstractChar` or `String` or `SubString{String}`.
# Examples
Expand All @@ -31,7 +31,7 @@ isvalid(value)
"""
isvalid(T, value) -> Bool
Returns `true` if the given value is valid for that type. Types currently can
Return `true` if the given value is valid for that type. Types currently can
be either `AbstractChar` or `String`. Values for `AbstractChar` can be of type `AbstractChar` or [`UInt32`](@ref).
Values for `String` can be of that type, `SubString{String}`, `Vector{UInt8}`,
or a contiguous subarray thereof.
Expand Down
4 changes: 2 additions & 2 deletions base/tuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ isless(::Tuple, ::Tuple{}) = false
"""
isless(t1::Tuple, t2::Tuple)
Returns true when t1 is less than t2 in lexicographic order.
Return `true` when `t1` is less than `t2` in lexicographic order.
"""
function isless(t1::Tuple, t2::Tuple)
a, b = t1[1], t2[1]
Expand Down Expand Up @@ -595,7 +595,7 @@ in(x::Symbol, @nospecialize itr::Tuple{Vararg{Symbol}}) = sym_in(x, itr)
"""
empty(x::Tuple)
Returns an empty tuple, `()`.
Return an empty tuple, `()`.
"""
empty(@nospecialize x::Tuple) = ()

Expand Down
6 changes: 3 additions & 3 deletions stdlib/Artifacts/src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ end
"""
artifact_exists(hash::SHA1; honor_overrides::Bool=true)
Returns whether or not the given artifact (identified by its sha1 git tree hash) exists
Return whether or not the given artifact (identified by its sha1 git tree hash) exists
on-disk. Note that it is possible that the given artifact exists in multiple locations
(e.g. within multiple depots).
Expand Down Expand Up @@ -455,7 +455,7 @@ end
include_lazy = false,
pkg_uuid = nothing)
Returns a dictionary where every entry is an artifact from the given `Artifacts.toml`
Return a dictionary where every entry is an artifact from the given `Artifacts.toml`
that should be downloaded for the requested platform. Lazy artifacts are included if
`include_lazy` is set.
"""
Expand Down Expand Up @@ -611,7 +611,7 @@ end
artifact_slash_lookup(name::String, atifact_dict::Dict,
artifacts_toml::String, platform::Platform)
Returns `artifact_name`, `artifact_path_tail`, and `hash` by looking the results up in
Return `artifact_name`, `artifact_path_tail`, and `hash` by looking the results up in
the given `artifacts_toml`, first extracting the name and path tail from the given `name`
to support slash-indexing within the given artifact.
"""
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Base64/src/Base64.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include("decode.jl")
"""
stringmime(mime, x; context=nothing)
Returns an `AbstractString` containing the representation of `x` in the
Return an `AbstractString` containing the representation of `x` in the
requested `mime` type. This is similar to [`repr(mime, x)`](@ref) except
that binary data is base64-encoded as an ASCII string.
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Dates/src/periods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Base.isfinite(::Union{Type{P}, P}) where {P<:Period} = true
"""
default(p::Period) -> Period
Returns a sensible "default" value for the input Period by returning `T(1)` for Year,
Return a sensible "default" value for the input Period by returning `T(1)` for Year,
Month, and Day, and `T(0)` for Hour, Minute, Second, and Millisecond.
"""
function default end
Expand Down
Loading

0 comments on commit 70c873e

Please sign in to comment.