-
-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathlibpython-clj2.java-api.html
More file actions
158 lines (156 loc) · 24.5 KB
/
libpython-clj2.java-api.html
File metadata and controls
158 lines (156 loc) · 24.5 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>libpython-clj2.java-api documentation</title><script async="true" src="https://www.googletagmanager.com/gtag/js?id=G-LN7PG6FJ2D"></script><script>window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-LN7PG6FJ2D');</script><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="highlight/solarized-light.css" /><script type="text/javascript" src="highlight/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a> with <a href="https://github.com/xsc/codox-theme-rdash">RDash UI</a> theme</h2><h1><a href="index.html"><span class="project-title"><span class="project-name">libpython-clj</span> <span class="project-version">2.026</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="Usage.html"><div class="inner"><span>LibPython-CLJ Usage</span></div></a></li><li class="depth-1 "><a href="embedded.html"><div class="inner"><span>Embedding Clojure In Python</span></div></a></li><li class="depth-1 "><a href="environments.html"><div class="inner"><span>Python Environments</span></div></a></li><li class="depth-1 "><a href="new-to-clojure.html"><div class="inner"><span>So Many Parenthesis!</span></div></a></li><li class="depth-1 "><a href="scopes-and-gc.html"><div class="inner"><span>Scopes And Garbage Collection</span></div></a></li><li class="depth-1 "><a href="slicing.html"><div class="inner"><span>Slicing And Slices</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>libpython-clj2</span></div></div></li><li class="depth-2 branch"><a href="libpython-clj2.codegen.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>codegen</span></div></a></li><li class="depth-2 branch"><a href="libpython-clj2.embedded.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>embedded</span></div></a></li><li class="depth-2 branch current"><a href="libpython-clj2.java-api.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>java-api</span></div></a></li><li class="depth-2"><a href="libpython-clj2.python.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>python</span></div></a></li><li class="depth-3 branch"><a href="libpython-clj2.python.class.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>class</span></div></a></li><li class="depth-3"><a href="libpython-clj2.python.np-array.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>np-array</span></div></a></li><li class="depth-2"><a href="libpython-clj2.require.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>require</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="libpython-clj2.java-api.html#var--arrayToJVM"><div class="inner"><span>-arrayToJVM</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--call"><div class="inner"><span>-call</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--callKw"><div class="inner"><span>-callKw</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--copyData"><div class="inner"><span>-copyData</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--copyToJVM"><div class="inner"><span>-copyToJVM</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--copyToPy"><div class="inner"><span>-copyToPy</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--createArray"><div class="inner"><span>-createArray</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--getAttr"><div class="inner"><span>-getAttr</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--getGlobal"><div class="inner"><span>-getGlobal</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--getItem"><div class="inner"><span>-getItem</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--GILLocker"><div class="inner"><span>-GILLocker</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--hasAttr"><div class="inner"><span>-hasAttr</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--hasItem"><div class="inner"><span>-hasItem</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--importModule"><div class="inner"><span>-importModule</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--initialize"><div class="inner"><span>-initialize</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--initializeEmbedded"><div class="inner"><span>-initializeEmbedded</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--lockGIL"><div class="inner"><span>-lockGIL</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--makeFastcallable"><div class="inner"><span>-makeFastcallable</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--runStringAsFile"><div class="inner"><span>-runStringAsFile</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--runStringAsInput"><div class="inner"><span>-runStringAsInput</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--setAttr"><div class="inner"><span>-setAttr</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--setGlobal"><div class="inner"><span>-setGlobal</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--setItem"><div class="inner"><span>-setItem</span></div></a></li><li class="depth-1"><a href="libpython-clj2.java-api.html#var--unlockGIL"><div class="inner"><span>-unlockGIL</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">libpython-clj2.java-api</h1><div class="doc"><div class="markdown"><p>A java api is exposed for libpython-clj2. The methods below are statically callable
without the leading '-'. Note that returned python objects implement the respective
java interfaces so a python dict will implement java.util.Map, etc. There is some
startup time as Clojure dynamically compiles the source code but this binding should
have great runtime characteristics in comparison to any other java python engine.</p>
<p>Note that you can pass java objects into python. An implementation of java.util.Map will
appear to python as a dict-like object an implementation of java.util.List will look
like a sequence and if the thing is iterable then it will be iterable in python.
To receive callbacks from python you can provide an implementation of the
interface <a href="https://clojure.github.io/clojure/javadoc/clojure/lang/IFn.html">clojure.lang.IFn</a></p>
<ul>
<li>see <a href="https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AFn.java">clojure.lang.AFn</a> for a base class that makes this easier.</li>
</ul>
<p>Performance:</p>
<p>There are a two logical ways to repeatedly invoke python functionality. The first is
to set some globals and repeatedly <a href="runStringAsInput">runStringAsInput</a> a script. The second is
'exec'ing a script, finding an exported function in the global dict and calling
that. With libpython-clj, the second pathway -- repeatedly calling a function --
is going to be faster than the first if the user makes a fastcallable out of the function
to be invoked. Here are some sample timings for an extremely simple function with two
arguments:</p>
<pre><code class="language-console">Python fn calls/ms 1923.2490094806021
Python fastcallable calls/ms 3776.767751742239
Python eval pathway calls/ms 2646.0478013509883
</code></pre>
<ul>
<li>
<p><a href="makeFastcallable">makeFastcallable</a> - - For the use case of repeatedly calling a single function - this
will cache the argument tuple for repeated use as opposed to allocating the argument tuple
every call. This can be a surprising amount faster -- 2x-3x -- than directly calling the
python callable. Once a fastcallable object is made you can either cast it to a
<a href="https://clojure.github.io/clojure/javadoc/clojure/lang/IFn.html">clojure.lang.IFn</a>
or call it via the provided <code>call</code> static method.</p>
</li>
<li>
<p>HAIR ON FIRE MODE - If you are certain you are correctly calling lockGIL and unlockGIL
then you can define a variable, <code>-Dlibpython_clj.manual_gil=true</code> that will disable
automatic GIL lock/unlock system and gil correctness checking. This is useful, for instance,
if you are going to lock libpython-clj to a thread and control all access to it yourself.
This pathway will get at most 10% above using fastcall by itself.</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="language-java"> java_api.initialize(null);
try (AutoCloseable locker = java_api.GILLocker()) {
np = java_api.importModule("numpy");
Object ones = java_api.getAttr(np, "ones");
ArrayList dims = new ArrayList();
dims.add(2);
dims.add(3);
Object npArray = java_api.call(ones, dims); //see fastcall notes above
...
}
</code></pre>
</div></div><div class="public anchor" id="var--arrayToJVM"><h3>-arrayToJVM</h3><div class="usage"><code>(-arrayToJVM pyobj)</code></div><div class="doc"><div class="markdown"><p>Copy (efficiently) a numeric numpy array into a jvm map containing keys "datatype",
"shape", and a jvm array "data" in flattened row-major form.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L582">view source</a></div></div><div class="public anchor" id="var--call"><h3>-call</h3><div class="usage"><code>(-call item)</code><code>(-call item arg1)</code><code>(-call item arg1 arg2)</code><code>(-call item arg1 arg2 arg3)</code><code>(-call item arg1 arg2 arg3 arg4)</code><code>(-call item arg1 arg2 arg3 arg4 arg5)</code><code>(-call item arg1 arg2 arg3 arg4 arg5 arg6)</code></div><div class="doc"><div class="markdown"><p>Call a clojure <code>IFn</code> object. Python callables implement this interface so this works for
python objects. This is a convenience method around casting implementation of
<a href="https://clojure.github.io/clojure/javadoc/clojure/lang/IFn.html">clojure.lang.IFn</a> and
calling <code>invoke</code> directly.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L475">view source</a></div></div><div class="public anchor" id="var--callKw"><h3>-callKw</h3><div class="usage"><code>(-callKw pyobj pos-args kw-args)</code></div><div class="doc"><div class="markdown"><p>Call a python callable with keyword arguments. Note that you don't need this pathway
to call python methods if you do not need keyword arguments; if the python object is
callable then it will implement <a href="https://clojure.github.io/clojure/javadoc/clojure/lang/IFn.html">clojure.lang.IFn</a> and you can use <code>invoke</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L458">view source</a></div></div><div class="public anchor" id="var--copyData"><h3>-copyData</h3><div class="usage"><code>(-copyData from to)</code></div><div class="doc"><div class="markdown"><p>Copy data from a jvm container into a numpy array or back. This allows you to use a fixed
preallocated set of numpy (and potentially jvm arrays) to transfer data back and forth
efficiently. The most efficient transfer will be from a java primitive array that matches
the numeric type of the numpy array. Also note the element count of the numpy array
and the jvm array must match.</p>
<p>Note this copies <em>from</em> the first argument <em>to</em> the second argument -- this is reverse the
normal memcpy argument order!!. Returns the destination (to) argument.</p>
<p>Not this does <em>not</em> work with array-of-arrays. It will work with, for instance,
a numpy matrix of shape <a href="2, 2">2, 2</a> and an double array of length 4.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L595">view source</a></div></div><div class="public anchor" id="var--copyToJVM"><h3>-copyToJVM</h3><div class="usage"><code>(-copyToJVM object)</code></div><div class="doc"><div class="markdown"><p>Copy a python object such as a dict or a list into a comparable JVM object.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L558">view source</a></div></div><div class="public anchor" id="var--copyToPy"><h3>-copyToPy</h3><div class="usage"><code>(-copyToPy object)</code></div><div class="doc"><div class="markdown"><p>Copy a basic jvm object, such as an implementation of java.util.Map or java.util.List to
a python object.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L551">view source</a></div></div><div class="public anchor" id="var--createArray"><h3>-createArray</h3><div class="usage"><code>(-createArray datatype shape data)</code></div><div class="doc"><div class="markdown"><p>Create a numpy array from a tuple of string datatype, shape and data.</p>
<ul>
<li><code>datatype</code> - One of "int8" "uint8" "int16" "uint16" "int32" "uint32"
"int64" "uint64" "float32" "float64".</li>
<li><code>shape</code> - integer array of dimension e.g. <code>[2,3]</code>.</li>
<li><code>data</code> - list or array of data. This will of course be fastest if the datatype
of the array matches the requested datatype.</li>
</ul>
<p>This does work with array-of-array structures assuming the shape is correct but those
will be slower than a single primitive array and a shape.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L564">view source</a></div></div><div class="public anchor" id="var--getAttr"><h3>-getAttr</h3><div class="usage"><code>(-getAttr pyobj attname)</code></div><div class="doc"><div class="markdown"><p>Get a python attribute. This corresponds to the python '.' operator.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L357">view source</a></div></div><div class="public anchor" id="var--getGlobal"><h3>-getGlobal</h3><div class="usage"><code>(-getGlobal varname)</code></div><div class="doc"><div class="markdown"><p>Get a value from the global dict. This function expects the GIL to be locked - it will
not lock/unlock it for you.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L397">view source</a></div></div><div class="public anchor" id="var--getItem"><h3>-getItem</h3><div class="usage"><code>(-getItem pyobj itemName)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L375">view source</a></div></div><div class="public anchor" id="var--GILLocker"><h3>-GILLocker</h3><div class="usage"><code>(-GILLocker)</code></div><div class="doc"><div class="markdown"><p>Lock the gil returning an AutoCloseable that will unlock the gil upon close.</p>
<p>Example:</p>
<pre><code class="language-java"> try (AutoCloseable locker = java_api.GILLocker()) {
... Do your python stuff.
}
</code></pre>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L334">view source</a></div></div><div class="public anchor" id="var--hasAttr"><h3>-hasAttr</h3><div class="usage"><code>(-hasAttr pyobj attname)</code></div><div class="doc"><div class="markdown"><p>Returns true if this python object has this attribute.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L351">view source</a></div></div><div class="public anchor" id="var--hasItem"><h3>-hasItem</h3><div class="usage"><code>(-hasItem pyobj itemName)</code></div><div class="doc"><div class="markdown"><p>Return true if this pyobj has this item</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L369">view source</a></div></div><div class="public anchor" id="var--importModule"><h3>-importModule</h3><div class="usage"><code>(-importModule modname)</code></div><div class="doc"><div class="markdown"><p>Import a python module. Module entries can be accessed via <code>getAttr</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L452">view source</a></div></div><div class="public anchor" id="var--initialize"><h3>-initialize</h3><div class="usage"><code>(-initialize options)</code></div><div class="doc"><div class="markdown"><p>See options for <a href="libpython-clj2.python.html#var-initialize.21">libpython-clj2.python/initialize!</a>. Note that the keyword
option arguments can be provided by using strings so <code>:library-path</code> becomes
the key "library-path". Also note that there is still a GIL underlying
all of the further operations so java should access python via single-threaded
pathways.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L291">view source</a></div></div><div class="public anchor" id="var--initializeEmbedded"><h3>-initializeEmbedded</h3><div class="usage"><code>(-initializeEmbedded)</code></div><div class="doc"><div class="markdown"><p>Initialize python when this library is being called <em>from</em> a python program. In
that case the system will look for the python symbols in the current executable.
See the <a href="https://clj-python.github.io/libpython-clj/embedded.html">embedded topic</a></p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L305">view source</a></div></div><div class="public anchor" id="var--lockGIL"><h3>-lockGIL</h3><div class="usage"><code>(-lockGIL)</code></div><div class="doc"><div class="markdown"><p>Attempt to lock the gil. This is safe to call in a reentrant manner.
Returns a long representing the gil state that must be passed into unlockGIL.</p>
<p>See documentation for <a href="https://docs.python.org/3/c-api/init.html#c.PyGILState_Ensure">pyGILState_Ensure</a>.</p>
<p>Note that the API will do this for you but locking
the GIL before doing a string of operations is faster than having each operation lock
the GIL individually.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L314">view source</a></div></div><div class="public anchor" id="var--makeFastcallable"><h3>-makeFastcallable</h3><div class="usage"><code>(-makeFastcallable item)</code></div><div class="doc"><div class="markdown"><p>Given a normal python callable, make a fastcallable object that needs to be closed.
This should be seen as a callsite optimization for repeatedly calling a specific python
function in a tight loop with positional arguments. It is not intended to be used in a
context where you will then pass this object around as this is not a reentrant optimization.</p>
<pre><code class="language-java"> try (AutoCloseable fastcaller = java_api.makeFastcallable(pycallable)) {
tightloop: {
java_api.call(fastcaller, arg1, arg2);
}
}
</code></pre>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L534">view source</a></div></div><div class="public anchor" id="var--runStringAsFile"><h3>-runStringAsFile</h3><div class="usage"><code>(-runStringAsFile strdata)</code></div><div class="doc"><div class="markdown"><p>Run a string returning the result of the last expression. Strings are compiled and
live for the life of the interpreter. This is the equivalent to the python
<a href="https://docs.python.org/3/library/functions.html#exec">exec</a> all.</p>
<p>The global context is returned as a java map.</p>
<p>This function expects the GIL to be locked - it will not lock/unlock it for you.</p>
<p>Example:</p>
<pre><code class="language-java"> Map globals = java_api.runStringAsFile("def calcSpread(bid,ask):
return bid-ask
");
Object spreadFn = globals.get("calcSpread");
java_api.call(spreadFn, 1, 2); // Returns -1
</code></pre>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L427">view source</a></div></div><div class="public anchor" id="var--runStringAsInput"><h3>-runStringAsInput</h3><div class="usage"><code>(-runStringAsInput strdata)</code></div><div class="doc"><div class="markdown"><p>Run a string returning the result of the last expression. Strings are compiled and
live for the life of the interpreter. This is the equivalent to the python
<a href="https://docs.python.org/3/library/functions.html#eval">eval</a> call.</p>
<p>This function expects the GIL to be locked - it will not lock/unlock it for you.</p>
<p>Example:</p>
<pre><code class="language-java"> java_api.setGlobal("bid", 1);
java_api.setGlobal("ask", 2);
java_api.runStringAsInput("bid-ask"); //Returns -1
</code></pre>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L404">view source</a></div></div><div class="public anchor" id="var--setAttr"><h3>-setAttr</h3><div class="usage"><code>(-setAttr pyobj attname objval)</code></div><div class="doc"><div class="markdown"><p>Set an attribute on a python object. This corresponds to the <code>__setattr</code> python call.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L363">view source</a></div></div><div class="public anchor" id="var--setGlobal"><h3>-setGlobal</h3><div class="usage"><code>(-setGlobal varname varval)</code></div><div class="doc"><div class="markdown"><p>Set a value in the global dict. This function expects the GIL to be locked - it will
not lock/unlock it for you.</p>
<p>In addition to numbers and strings, this method can take an implementation of
<code>clojure.lang.IFn</code> that will be converted to a python callable, arrays and lists
will be converted to python lists. If you would like numpy arrays use <a href="libpython-clj2.java-api.html#var--createArray">-createArray</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L385">view source</a></div></div><div class="public anchor" id="var--setItem"><h3>-setItem</h3><div class="usage"><code>(-setItem pyobj itemName itemVal)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L380">view source</a></div></div><div class="public anchor" id="var--unlockGIL"><h3>-unlockGIL</h3><div class="usage"><code>(-unlockGIL gilstate)</code></div><div class="doc"><div class="markdown"><p>Unlock the gil passing in the gilstate returned from lockGIL. Each call to lockGIL must
be paired to a call to unlockGIL.</p>
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/java_api.clj#L327">view source</a></div></div></div></body></html>