-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html PUBLIC "" | ||
""> | ||
<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 || []; | ||
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.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->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 | ||
implementation technique for bridging JVM objects into python.</p> | ||
</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 | ||
will be presented as instance methods. | ||
Things in the cls hashmap had better be either atoms or already converted | ||
python objects. You may get surprised otherwise; you have been warned. | ||
See the classes-test file in test/libpython-clj</p> | ||
</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 & [{: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 | ||
it's first argument. In this case the default behavior is to | ||
pass as-jvm bridged python object ptr args and kw dict args to the clojure function without | ||
marshalling. Self will be the first argument of the arg vector.</p> | ||
<p>See options to <a href="libpython-clj2.python.html#var-make-callable">libpython-clj2.python/make-callable</a>.</p> | ||
<p>Options:</p> | ||
<ul> | ||
<li><code>:arg-converter</code> - gets one argument and must convert into jvm space - defaults to as-jvm.</li> | ||
<li><code>:result-converter</code> - gets one argument and must convert to python space. | ||
Has reasonable default.</li> | ||
</ul> | ||
</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 & [{: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 | ||
it's first argument. In this case the default behavior is to | ||
pass raw python object ptr args to the clojure function without marshalling | ||
as that can add confusion and unnecessary overhead. Self will be the first argument. | ||
Callers can change this behavior by setting the 'arg-converter' option as in | ||
'make-tuple-fn'.</p> | ||
<p>See options to <a href="libpython-clj2.python.html#var-make-callable">libpython-clj2.python/make-callable</a>.</p> | ||
</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->instance-fn</h3><div class="usage"><code>(py-fn->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 | ||
in class definitions.</p> | ||
</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> |