From 70c873e5f82b8143fec1df70d0816b529856ae69 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 27 Oct 2022 11:48:23 +0200 Subject: [PATCH] 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 --- base/abstractarray.jl | 2 +- base/asyncevent.jl | 2 +- base/intfuncs.jl | 2 +- base/logging.jl | 4 ++-- base/meta.jl | 2 +- base/methodshow.jl | 4 ++-- base/multimedia.jl | 8 ++++---- base/number.jl | 4 ++-- base/reduce.jl | 18 +++++++++--------- base/set.jl | 2 +- base/stacktraces.jl | 6 +++--- base/stat.jl | 2 +- base/strings/unicode.jl | 4 ++-- base/tuple.jl | 4 ++-- stdlib/Artifacts/src/Artifacts.jl | 6 +++--- stdlib/Base64/src/Base64.jl | 2 +- stdlib/Dates/src/periods.jl | 2 +- stdlib/LinearAlgebra/src/blas.jl | 16 ++++++++-------- stdlib/LinearAlgebra/src/generic.jl | 4 ++-- stdlib/Markdown/src/parse/util.jl | 2 +- stdlib/Profile/src/Profile.jl | 2 +- stdlib/REPL/src/TerminalMenus/AbstractMenu.jl | 2 +- stdlib/SharedArrays/src/SharedArrays.jl | 6 +++--- stdlib/Sockets/src/IPAddr.jl | 4 ++-- stdlib/Test/src/Test.jl | 6 +++--- stdlib/Unicode/src/Unicode.jl | 4 ++-- 26 files changed, 60 insertions(+), 60 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 5db773b7d8ae7..b42aee1f3a36a 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -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 diff --git a/base/asyncevent.jl b/base/asyncevent.jl index d3938bd66c842..183f38613a50f 100644 --- a/base/asyncevent.jl +++ b/base/asyncevent.jl @@ -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")) diff --git a/base/intfuncs.jl b/base/intfuncs.jl index 823deee94f173..168c9f1e3b7ad 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -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 diff --git a/base/logging.jl b/base/logging.jl index 809a9368d95bd..d7dc45122e063 100644 --- a/base/logging.jl +++ b/base/logging.jl @@ -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 @@ -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 diff --git a/base/meta.jl b/base/meta.jl index c9bad2bb8a4a5..b0e0dc371b26c 100644 --- a/base/meta.jl +++ b/base/meta.jl @@ -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)`. diff --git a/base/methodshow.jl b/base/methodshow.jl index 25ac5bba97d03..83c5421530956 100644 --- a/base/methodshow.jl +++ b/base/methodshow.jl @@ -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) @@ -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)) diff --git a/base/multimedia.jl b/base/multimedia.jl index 308cc07a05a53..e634a19b7d6aa 100644 --- a/base/multimedia.jl +++ b/base/multimedia.jl @@ -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 @@ -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 @@ -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. """ @@ -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.) """ diff --git a/base/number.jl b/base/number.jl index c90e2ce4a3875..31aa616b0eb55 100644 --- a/base/number.jl +++ b/base/number.jl @@ -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). @@ -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`). diff --git a/base/reduce.jl b/base/reduce.jl index a7f821a73be92..9df2171a96fd1 100644 --- a/base/reduce.jl +++ b/base/reduce.jl @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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. @@ -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. diff --git a/base/set.jl b/base/set.jl index c1c9cc91d29c1..6f8580e222e40 100644 --- a/base/set.jl +++ b/base/set.jl @@ -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 diff --git a/base/stacktraces.jl b/base/stacktraces.jl index 3cb81d82bd3f7..ad088ffb51855 100644 --- a/base/stacktraces.jl +++ b/base/stacktraces.jl @@ -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`. """ @@ -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) @@ -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 diff --git a/base/stat.jl b/base/stat.jl index 13dbca7780b61..09cf8f8eae808 100644 --- a/base/stat.jl +++ b/base/stat.jl @@ -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 | diff --git a/base/strings/unicode.jl b/base/strings/unicode.jl index 821e186501d1d..17c5d66c160b6 100644 --- a/base/strings/unicode.jl +++ b/base/strings/unicode.jl @@ -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 @@ -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. diff --git a/base/tuple.jl b/base/tuple.jl index c84b207e2ab2c..689645b35fcbb 100644 --- a/base/tuple.jl +++ b/base/tuple.jl @@ -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] @@ -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) = () diff --git a/stdlib/Artifacts/src/Artifacts.jl b/stdlib/Artifacts/src/Artifacts.jl index 3f1574db4c4a6..4bcf98df2a1d9 100644 --- a/stdlib/Artifacts/src/Artifacts.jl +++ b/stdlib/Artifacts/src/Artifacts.jl @@ -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). @@ -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. """ @@ -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. """ diff --git a/stdlib/Base64/src/Base64.jl b/stdlib/Base64/src/Base64.jl index 108faa18f5b85..f1fef096888ed 100644 --- a/stdlib/Base64/src/Base64.jl +++ b/stdlib/Base64/src/Base64.jl @@ -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. diff --git a/stdlib/Dates/src/periods.jl b/stdlib/Dates/src/periods.jl index 7eb71ff2905cf..9b7e29496e642 100644 --- a/stdlib/Dates/src/periods.jl +++ b/stdlib/Dates/src/periods.jl @@ -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 diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index ddbc89d02ef5f..6048fee0a9a69 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -1737,14 +1737,14 @@ hemm! Rank-k update of the symmetric matrix `C` as `alpha*A*transpose(A) + beta*C` or `alpha*transpose(A)*A + beta*C` according to [`trans`](@ref stdlib-blas-trans). -Only the [`uplo`](@ref stdlib-blas-uplo) triangle of `C` is used. Returns `C`. +Only the [`uplo`](@ref stdlib-blas-uplo) triangle of `C` is used. Return `C`. """ function syrk! end """ syrk(uplo, trans, alpha, A) -Returns either the upper triangle or the lower triangle of `A`, +Return either the upper triangle or the lower triangle of `A`, according to [`uplo`](@ref stdlib-blas-uplo), of `alpha*A*transpose(A)` or `alpha*transpose(A)*A`, according to [`trans`](@ref stdlib-blas-trans). @@ -1916,7 +1916,7 @@ end """ syr2k(uplo, trans, A, B) -Returns the [`uplo`](@ref stdlib-blas-uplo) triangle of `A*transpose(B) + B*transpose(A)` +Return the [`uplo`](@ref stdlib-blas-uplo) triangle of `A*transpose(B) + B*transpose(A)` or `transpose(A)*B + transpose(B)*A`, according to [`trans`](@ref stdlib-blas-trans). """ syr2k(uplo::AbstractChar, trans::AbstractChar, A::AbstractVecOrMat, B::AbstractVecOrMat) = syr2k(uplo, trans, one(eltype(A)), A, B) @@ -1969,14 +1969,14 @@ end Rank-2k update of the Hermitian matrix `C` as `alpha*A*B' + alpha*B*A' + beta*C` or `alpha*A'*B + alpha*B'*A + beta*C` according to [`trans`](@ref stdlib-blas-trans). The scalar `beta` has to be real. -Only the [`uplo`](@ref stdlib-blas-uplo) triangle of `C` is used. Returns `C`. +Only the [`uplo`](@ref stdlib-blas-uplo) triangle of `C` is used. Return `C`. """ function her2k! end """ her2k(uplo, trans, alpha, A, B) -Returns the [`uplo`](@ref stdlib-blas-uplo) triangle of `alpha*A*B' + alpha*B*A'` +Return the [`uplo`](@ref stdlib-blas-uplo) triangle of `alpha*A*B' + alpha*B*A'` or `alpha*A'*B + alpha*B'*A`, according to [`trans`](@ref stdlib-blas-trans). """ her2k(uplo, trans, alpha, A, B) @@ -1984,7 +1984,7 @@ her2k(uplo, trans, alpha, A, B) """ her2k(uplo, trans, A, B) -Returns the [`uplo`](@ref stdlib-blas-uplo) triangle of `A*B' + B*A'` +Return the [`uplo`](@ref stdlib-blas-uplo) triangle of `A*B' + B*A'` or `A'*B + B'*A`, according to [`trans`](@ref stdlib-blas-trans). """ her2k(uplo, trans, A, B) @@ -1999,14 +1999,14 @@ Update `B` as `alpha*A*B` or one of the other three variants determined by Only the [`ul`](@ref stdlib-blas-uplo) triangle of `A` is used. [`dA`](@ref stdlib-blas-diag) determines if the diagonal values are read or are assumed to be all ones. -Returns the updated `B`. +Return the updated `B`. """ function trmm! end """ trmm(side, ul, tA, dA, alpha, A, B) -Returns `alpha*A*B` or one of the other three variants determined by +Return `alpha*A*B` or one of the other three variants determined by [`side`](@ref stdlib-blas-side) and [`tA`](@ref stdlib-blas-trans). Only the [`ul`](@ref stdlib-blas-uplo) triangle of `A` is used. [`dA`](@ref stdlib-blas-diag) determines if the diagonal values are read or diff --git a/stdlib/LinearAlgebra/src/generic.jl b/stdlib/LinearAlgebra/src/generic.jl index bedd50ab94ff7..7d472856b3ac8 100644 --- a/stdlib/LinearAlgebra/src/generic.jl +++ b/stdlib/LinearAlgebra/src/generic.jl @@ -367,7 +367,7 @@ tril(M::AbstractMatrix) = tril!(copy(M)) """ triu(M, k::Integer) -Returns the upper triangle of `M` starting from the `k`th superdiagonal. +Return the upper triangle of `M` starting from the `k`th superdiagonal. # Examples ```jldoctest @@ -398,7 +398,7 @@ triu(M::AbstractMatrix,k::Integer) = triu!(copy(M),k) """ tril(M, k::Integer) -Returns the lower triangle of `M` starting from the `k`th superdiagonal. +Return the lower triangle of `M` starting from the `k`th superdiagonal. # Examples ```jldoctest diff --git a/stdlib/Markdown/src/parse/util.jl b/stdlib/Markdown/src/parse/util.jl index 7be845c96a9fc..aabfcbb3ddc62 100644 --- a/stdlib/Markdown/src/parse/util.jl +++ b/stdlib/Markdown/src/parse/util.jl @@ -36,7 +36,7 @@ function skipblank(io::IO) end """ -Returns true if the line contains only (and, unless allowempty, +Return true if the line contains only (and, unless allowempty, at least one of) the characters given. """ function linecontains(io::IO, chars; allow_whitespace = true, diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index 572a2ad5d4abd..07e727e445239 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -607,7 +607,7 @@ error_codes = Dict( """ fetch(;include_meta = true) -> data -Returns a copy of the buffer of profile backtraces. Note that the +Return a copy of the buffer of profile backtraces. Note that the values in `data` have meaning only on this machine in the current session, because it depends on the exact memory addresses used in JIT-compiling. This function is primarily for internal use; [`retrieve`](@ref) may be a better choice for most users. diff --git a/stdlib/REPL/src/TerminalMenus/AbstractMenu.jl b/stdlib/REPL/src/TerminalMenus/AbstractMenu.jl index 127d0cd88a2cf..2dc7161be99da 100644 --- a/stdlib/REPL/src/TerminalMenus/AbstractMenu.jl +++ b/stdlib/REPL/src/TerminalMenus/AbstractMenu.jl @@ -131,7 +131,7 @@ end """ header(m::AbstractMenu) -> String -Returns a header string to be printed above the menu. +Return a header string to be printed above the menu. Defaults to "". """ header(m::AbstractMenu) = "" diff --git a/stdlib/SharedArrays/src/SharedArrays.jl b/stdlib/SharedArrays/src/SharedArrays.jl index 90de5fbac75be..f9f701c61fcea 100644 --- a/stdlib/SharedArrays/src/SharedArrays.jl +++ b/stdlib/SharedArrays/src/SharedArrays.jl @@ -328,7 +328,7 @@ procs(S::SharedArray) = S.pids """ indexpids(S::SharedArray) -Returns the current worker's index in the list of workers +Return the current worker's index in the list of workers mapping the `SharedArray` (i.e. in the same list returned by `procs(S)`), or 0 if the `SharedArray` is not mapped locally. """ @@ -337,7 +337,7 @@ indexpids(S::SharedArray) = S.pidx """ sdata(S::SharedArray) -Returns the actual `Array` object backing `S`. +Return the actual `Array` object backing `S`. """ sdata(S::SharedArray) = S.s sdata(A::AbstractArray) = A @@ -345,7 +345,7 @@ sdata(A::AbstractArray) = A """ localindices(S::SharedArray) -Returns a range describing the "default" indices to be handled by the +Return a range describing the "default" indices to be handled by the current process. This range should be interpreted in the sense of linear indexing, i.e., as a sub-range of `1:length(S)`. In multi-process contexts, returns an empty range in the parent process diff --git a/stdlib/Sockets/src/IPAddr.jl b/stdlib/Sockets/src/IPAddr.jl index 1792008620981..04710e400fe87 100644 --- a/stdlib/Sockets/src/IPAddr.jl +++ b/stdlib/Sockets/src/IPAddr.jl @@ -31,7 +31,7 @@ end """ IPv4(host::Integer) -> IPv4 -Returns an IPv4 object from ip address `host` formatted as an [`Integer`](@ref). +Return an IPv4 object from ip address `host` formatted as an [`Integer`](@ref). # Examples ```jldoctest @@ -84,7 +84,7 @@ end """ IPv6(host::Integer) -> IPv6 -Returns an IPv6 object from ip address `host` formatted as an [`Integer`](@ref). +Return an IPv6 object from ip address `host` formatted as an [`Integer`](@ref). # Examples ```jldoctest diff --git a/stdlib/Test/src/Test.jl b/stdlib/Test/src/Test.jl index 8a3d028d51769..c19d131781b8f 100644 --- a/stdlib/Test/src/Test.jl +++ b/stdlib/Test/src/Test.jl @@ -1689,7 +1689,7 @@ end """ get_testset_depth() -Returns the number of active test sets, not including the default test set +Return the number of active test sets, not including the default test set """ function get_testset_depth() testsets = get(task_local_storage(), :__BASETESTNEXT__, AbstractTestSet[]) @@ -1819,7 +1819,7 @@ end ambiguous_bottom=false, allowed_undefineds=nothing) -Returns a vector of `(Method,Method)` pairs of ambiguous methods +Return a vector of `(Method,Method)` pairs of ambiguous methods defined in the specified modules. Use `recursive=true` to test in all submodules. @@ -1896,7 +1896,7 @@ end """ detect_unbound_args(mod1, mod2...; recursive=false, allowed_undefineds=nothing) -Returns a vector of `Method`s which may have unbound type parameters. +Return a vector of `Method`s which may have unbound type parameters. Use `recursive=true` to test in all submodules. By default, any undefined symbols trigger a warning. This warning can diff --git a/stdlib/Unicode/src/Unicode.jl b/stdlib/Unicode/src/Unicode.jl index 0467a8d50aa6b..58b9ab41b790a 100644 --- a/stdlib/Unicode/src/Unicode.jl +++ b/stdlib/Unicode/src/Unicode.jl @@ -120,7 +120,7 @@ normalize(s::AbstractString; kwargs...) = Base.Unicode.normalize(s; kwargs...) """ Unicode.isassigned(c) -> Bool -Returns `true` if the given char or integer is an assigned Unicode code point. +Return `true` if the given char or integer is an assigned Unicode code point. # Examples ```jldoctest @@ -136,7 +136,7 @@ isassigned(c) = Base.Unicode.isassigned(c) """ graphemes(s::AbstractString) -> GraphemeIterator -Returns an iterator over substrings of `s` that correspond to the extended graphemes in the +Return an iterator over substrings of `s` that correspond to the extended graphemes in the string, as defined by Unicode UAX #29. (Roughly, these are what users would perceive as single characters, even though they may contain more than one codepoint; for example a letter combined with an accent mark is a single grapheme.)