Fix deprecation warning triggered by PEP 479
This commit is contained in:
parent
316220b742
commit
be6ddd4bb2
@ -29,15 +29,15 @@
|
|||||||
(try (while True
|
(try (while True
|
||||||
(yield (get self index))
|
(yield (get self index))
|
||||||
(setv index (inc index)))
|
(setv index (inc index)))
|
||||||
(except [_ IndexError]
|
(except [IndexError]
|
||||||
(raise StopIteration))))
|
(return))))
|
||||||
--len-- (fn [self]
|
--len-- (fn [self]
|
||||||
"length of the sequence, dangerous for infinite sequences"
|
"length of the sequence, dangerous for infinite sequences"
|
||||||
(setv index (. self high-water))
|
(setv index (. self high-water))
|
||||||
(try (while True
|
(try (while True
|
||||||
(get self index)
|
(get self index)
|
||||||
(setv index (inc index)))
|
(setv index (inc index)))
|
||||||
(except [_ IndexError]
|
(except [IndexError]
|
||||||
(len (. self cache)))))
|
(len (. self cache)))))
|
||||||
max-items-in-repr 10
|
max-items-in-repr 10
|
||||||
--str-- (fn [self]
|
--str-- (fn [self]
|
||||||
|
@ -422,7 +422,10 @@ Raises ValueError for (not (pos? n))."
|
|||||||
(for* [val citer]
|
(for* [val citer]
|
||||||
(yield val)
|
(yield val)
|
||||||
(for* [_ (range skip)]
|
(for* [_ (range skip)]
|
||||||
(next citer))))
|
(try
|
||||||
|
(next citer)
|
||||||
|
(except [StopIteration]
|
||||||
|
(return))))))
|
||||||
|
|
||||||
(defn zero? [n]
|
(defn zero? [n]
|
||||||
"Check if `n` equals 0."
|
"Check if `n` equals 0."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user