-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
iterator.clj
32 lines (24 loc) · 930 Bytes
/
iterator.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(ns libpython-clj.jna.protocols.iterator
(:require [libpython-clj.jna.base
:refer [def-pylib-fn
ensure-pyobj
ensure-pytuple
ensure-pydict
size-t-type
*python-library*]
:as libpy-base]
[tech.jna :as jna])
(:import [com.sun.jna Pointer]
[libpython_clj.jna PyObject]))
(def-pylib-fn PyIter_Check
"Return true if the object o supports the iterator protocol."
Integer
[o ensure-pyobj])
(def-pylib-fn PyIter_Next
"Return value: New reference.
Return the next value from the iteration o. The object must be an iterator (it is up
to the caller to check this). If there are no remaining values, returns NULL with no
exception set. If an error occurs while retrieving the item, returns NULL and passes
along the exception."
Pointer
[o ensure-pyobj])