You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
range(start[, stop]; length, stop, step=1)
Given a starting value, construct a range either by length or from start
to stop, optionally with a given step (defaults to 1, a UnitRange). One of
length or stop is required. If length, stop, and step are all specified, they
must agree.
Based on the docs it seems like range(1, 5) should be valid, but it throws the error that "at least one of length or step must be specified".
From the doc header it looks like step is specified by default, so it seems weird that range(1, 5) would be different from range(1, 5; step=1). Also it makes it look like stop can be specified either positionally or by keyword, so I'd think specifying positionally would satisfy that "One of length or stop is required".
Based on the discussion in #28708 this seems like the intended behavior, but it seems like allowing range(a, b) would be consistent with the docs and somewhat simpler as just meaning the same thing as a:b.
This confusion popped up in a recent PR in DSP.jl.
As of 1.1 the docs for
range
say:Based on the docs it seems like
range(1, 5)
should be valid, but it throws the error that "at least one oflength
orstep
must be specified".From the doc header it looks like
step
is specified by default, so it seems weird thatrange(1, 5)
would be different fromrange(1, 5; step=1)
. Also it makes it look likestop
can be specified either positionally or by keyword, so I'd think specifying positionally would satisfy that "One of length or stop is required".Based on the discussion in #28708 this seems like the intended behavior, but it seems like allowing
range(a, b)
would be consistent with the docs and somewhat simpler as just meaning the same thing asa:b
.This confusion popped up in a recent PR in DSP.jl.
(@galenlynch)
The text was updated successfully, but these errors were encountered: