use .. warning:: (#17226)

* remove unnecessary when statement

* remove outdated codes

* use warnings
This commit is contained in:
flywind
2021-03-04 18:34:55 +08:00
committed by GitHub
parent c180de60a8
commit 5670b848cb
5 changed files with 13 additions and 16 deletions

View File

@@ -563,7 +563,8 @@ proc product*[T](x: openArray[seq[T]]): seq[seq[T]] =
## Produces the Cartesian product of the array.
## Every element of the result is a combination of one element from each seq in `x`,
## with the ith element coming from `x[i]`.
## Warning: complexity may explode.
##
## .. warning:: complexity may explode.
runnableExamples:
assert product(@[@[1], @[2]]) == @[@[1, 2]]
assert product(@[@["A", "K"], @["Q"]]) == @[@["K", "Q"], @["A", "Q"]]