From a296b4429f4534e65214f1d0ac7b0739695beb9b Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 9 Dec 2014 14:02:23 -0500 Subject: [PATCH] Use range syntax for description of `squeeze` requirements --- base/abstractarray.jl | 2 +- doc/stdlib/base.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 332c286a9bda9..0c7c031eda094 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -149,7 +149,7 @@ _sub(t::Tuple, s::Tuple) = _sub(tail(t), tail(s)) function squeeze(A::AbstractArray, dims::Dims) for i in 1:length(dims) - 1 <= dims[i] <= ndims(A) || error("squeezed dims must be in range [1, ndims(A)]") + 1 <= dims[i] <= ndims(A) || error("squeezed dims must be in range 1:ndims(A)") size(A, dims[i]) == 1 || error("squeezed dims must all be size 1") for j = 1:i-1 dims[j] == dims[i] && error("squeezed dims must be unique") diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst index 6a0a938f251a9..55c03e1bc2c8b 100644 --- a/doc/stdlib/base.rst +++ b/doc/stdlib/base.rst @@ -4484,7 +4484,7 @@ Indexing, Assignment, and Concatenation .. function:: squeeze(A, dims) Remove the dimensions specified by ``dims`` from array ``A``. Elements of - ``dims`` must be unique and be within the interval ``[1, ndims(A)]``. + ``dims`` must be unique and within the range ``1:ndims(A)``. .. function:: vec(Array) -> Vector