Document that system:pop() may raise IndexDefect (#21070)
* Document system:pop() may raise IndexDefect * Add backticks to KeyError
This commit is contained in:
parent
7ae7832f76
commit
e4aadcf1c1
2 changed files with 5 additions and 3 deletions
|
|
@ -1664,6 +1664,8 @@ proc contains*[T](a: openArray[T], item: T): bool {.inline.}=
|
|||
proc pop*[T](s: var seq[T]): T {.inline, noSideEffect.} =
|
||||
## Returns the last item of `s` and decreases `s.len` by one. This treats
|
||||
## `s` as a stack and implements the common *pop* operation.
|
||||
##
|
||||
## Raises `IndexDefect` if `s` is empty.
|
||||
runnableExamples:
|
||||
var a = @[1, 3, 5, 7]
|
||||
let b = pop(a)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue