With two many huge things we had to skip a few versions!
require-python
works like require but it works on python modules.
require-python
dynamically loads the module and exports it's symbols into
a clojure namespace. There are many options available for this pathway.
This implements a big step towards embedding python in Clojure in a simple,
clear, and easy to use way. One important thing to consider is the require
has a :reload:
option to allow you to actively develop a python module and
test it via clojure.
This excellent work was in large part done by James Tolton.
You can now extend a tuple of python classes (or implement a new one). This system
allows, among many things, us to use frameworks that use derivation as part of their
public API. Please see classes-test for a documented
example of a simple pathway through the new API. Note that if you use vanilla
->py-fn
functions as part of the class definition you won't get access to the self
object.
A general stability bugfix was made that was involved in the interoperation of Clojure functions within Python. Clojure functions weren't currently adding a refcount to their return values.
Fixed a bug where the system would load multiple python libraries, not stopping after the first valid library loaded. There are two ways to control the system's python library loading mechanism:
Moar syntax sugar --
user> (py/$. numpy linspace)
<function linspace at 0x7fa6642766a8>
user> (py/$.. numpy random shuffle)
<built-in method shuffle of numpy.random.mtrand.RandomState object at 0x7fa66410cca8>
libpython-clj now searches for several shared libraries instead of being hardcoded to just one of them. Because of this, there is now:
libpython-clj.jna.base/*python-library-names*
This is a sequence of library names that will be tried in order.
You can also pass in the desired library name as part of the initialize! call and only this name will be tried.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close