Skip to content

Commit f146cbd

Browse files
committed
Updating class docs
1 parent b1aa2ef commit f146cbd

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/libpython-clj2.python.class.html

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html PUBLIC ""
2+
"">
3+
<html><head><meta charset="UTF-8" /><title>libpython-clj2.python.class documentation</title><script async="true" src="https://www.googletagmanager.com/gtag/js?id=G-LN7PG6FJ2D"></script><script>window.dataLayer = window.dataLayer || [];
4+
function gtag(){dataLayer.push(arguments);}
5+
gtag('js', new Date());
6+
7+
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.024</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"><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 current"><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.python.class.html#var-create-class"><div class="inner"><span>create-class</span></div></a></li><li class="depth-1"><a href="libpython-clj2.python.class.html#var-make-kw-instance-fn"><div class="inner"><span>make-kw-instance-fn</span></div></a></li><li class="depth-1"><a href="libpython-clj2.python.class.html#var-make-tuple-instance-fn"><div class="inner"><span>make-tuple-instance-fn</span></div></a></li><li class="depth-1"><a href="libpython-clj2.python.class.html#var-py-fn-.3Einstance-fn"><div class="inner"><span>py-fn-&gt;instance-fn</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">libpython-clj2.python.class</h1><div class="doc"><div class="markdown"><p>Namespace to help create a new python class from Clojure. Used as a core
8+
implementation technique for bridging JVM objects into python.</p>
9+
</div></div><div class="public anchor" id="var-create-class"><h3>create-class</h3><div class="usage"><code>(create-class name bases cls-hashmap)</code></div><div class="doc"><div class="markdown"><p>Create a new class object. Any callable values in the cls-hashmap
10+
will be presented as instance methods.
11+
Things in the cls hashmap had better be either atoms or already converted
12+
python objects. You may get surprised otherwise; you have been warned.
13+
See the classes-test file in test/libpython-clj</p>
14+
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/python/class.clj#L70">view source</a></div></div><div class="public anchor" id="var-make-kw-instance-fn"><h3>make-kw-instance-fn</h3><div class="usage"><code>(make-kw-instance-fn clj-fn &amp; [{:keys [arg-converter result-converter], :or {arg-converter py-base/as-jvm}, :as options}])</code></div><div class="doc"><div class="markdown"><p>Make an instance function - a function which will be passed the 'this' object as
15+
it's first argument. In this case the default behavior is to
16+
pass as-jvm bridged python object ptr args and kw dict args to the clojure function without
17+
marshalling. Self will be the first argument of the arg vector.</p>
18+
<p>See options to <a href="libpython-clj2.python.html#var-make-callable">libpython-clj2.python/make-callable</a>.</p>
19+
<p>Options:</p>
20+
<ul>
21+
<li><code>:arg-converter</code> - gets one argument and must convert into jvm space - defaults to as-jvm.</li>
22+
<li><code>:result-converter</code> - gets one argument and must convert to python space.
23+
Has reasonable default.</li>
24+
</ul>
25+
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/python/class.clj#L43">view source</a></div></div><div class="public anchor" id="var-make-tuple-instance-fn"><h3>make-tuple-instance-fn</h3><div class="usage"><code>(make-tuple-instance-fn clj-fn &amp; [{:keys [arg-converter], :or {arg-converter py-base/as-jvm}, :as options}])</code></div><div class="doc"><div class="markdown"><p>Make an instance function - a function which will be passed the 'this' object as
26+
it's first argument. In this case the default behavior is to
27+
pass raw python object ptr args to the clojure function without marshalling
28+
as that can add confusion and unnecessary overhead. Self will be the first argument.
29+
Callers can change this behavior by setting the 'arg-converter' option as in
30+
'make-tuple-fn'.</p>
31+
<p>See options to <a href="libpython-clj2.python.html#var-make-callable">libpython-clj2.python/make-callable</a>.</p>
32+
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/python/class.clj#L23">view source</a></div></div><div class="public anchor" id="var-py-fn-.3Einstance-fn"><h3>py-fn-&gt;instance-fn</h3><div class="usage"><code>(py-fn-&gt;instance-fn py-fn)</code></div><div class="doc"><div class="markdown"><p>Given a python callable, return an instance function meant to be used
33+
in class definitions.</p>
34+
</div></div><div class="src-link"><a href="https://github.com/clj-python/libpython-clj/blob/master/src/libpython_clj2/python/class.clj#L13">view source</a></div></div></div></body></html>

0 commit comments

Comments
 (0)