Fix deprecation warning triggered by PEP 479

This commit is contained in:
Simon Gomizelj 2018-02-08 14:56:41 -05:00
parent 316220b742
commit be6ddd4bb2
2 changed files with 7 additions and 4 deletions

View File

@ -29,15 +29,15 @@
(try (while True
(yield (get self index))
(setv index (inc index)))
(except [_ IndexError]
(raise StopIteration))))
(except [IndexError]
(return))))
--len-- (fn [self]
"length of the sequence, dangerous for infinite sequences"
(setv index (. self high-water))
(try (while True
(get self index)
(setv index (inc index)))
(except [_ IndexError]
(except [IndexError]
(len (. self cache)))))
max-items-in-repr 10
--str-- (fn [self]

View File

@ -422,7 +422,10 @@ Raises ValueError for (not (pos? n))."
(for* [val citer]
(yield val)
(for* [_ (range skip)]
(next citer))))
(try
(next citer)
(except [StopIteration]
(return))))))
(defn zero? [n]
"Check if `n` equals 0."