Liking cljdoc? Tell your friends :D

libpython-clj.python.object

Base support for python objects and python->jvm interop. At this level (without interop), we can only support the copying protocols; we can't do bridging. Still, copying gets you quite far and you can, for instance, call python functions and get the attribute map from a python object.

Protocol functions implemented: python-type ->python ->jvm dir has-attr? attr callable? has-item? item set-item! do-call-fn len

Results of these, when they return python pointers, return the raw,unwrapped pointers. Callers at this level are sitting just close enough to the actual libpy calls to still get pointers back but they don't have to manage the gil.

Base support for python objects and python->jvm interop.  At this level (without
interop), we can only support the copying protocols; we can't do bridging.  Still,
copying gets you quite far and you can, for instance, call python functions and get
the attribute map from a python object.

Protocol functions implemented:
python-type
->python
->jvm
dir
has-attr?
attr
callable?
has-item?
item
set-item!
do-call-fn
len

Results of these, when they return python pointers, return the raw,unwrapped pointers.
Callers at this level are sitting just close enough to the actual libpy calls to still
get pointers back *but* they don't have to manage the gil.
raw docstring

*item-tuple-cutoff*clj


*object-reference-logging*clj


->jvmclj

(->jvm item & [options])

Copy an object into the jvm (if it wasn't there already.)

Copy an object into the jvm (if it wasn't there already.)
raw docstring

->py-dictclj

(->py-dict item)

->py-floatclj

(->py-float item)

->py-fnclj

(->py-fn fn-obj
         {:keys [method-name documentation py-self]
          :or {method-name "unnamed_function" documentation "not documented"}})

Create a python callback from a clojure fn. If clojure fn, then tuple arguments are used. If keyword arguments are desired, the pass in something derived from: libpython-clj.jna.CFunction$KeyWordFunction. If a pure fn is passed in, arguments are marshalled from python if possible and then to-python in the case of successful execution. An exception will set the error indicator.

Create a python callback from a clojure fn.
If clojure fn, then tuple arguments are used.  If keyword arguments are desired,
the pass in something derived from: libpython-clj.jna.CFunction$KeyWordFunction.
If a pure fn is passed in, arguments are marshalled from python if possible and
then to-python in the case of successful execution.  An exception will set the error
indicator.
raw docstring

->py-listclj

(->py-list item-seq)

->py-longclj

(->py-long item)

->py-setclj

(->py-set item)

->py-stringclj

(->py-string item)

->py-tupleclj

(->py-tuple item-seq)

->pythonclj

(->python item & [options])

Completely convert a jvm object to a python copy.

Completely convert a jvm object to a python copy.
raw docstring

apply-method-def-data!clj

(apply-method-def-data! method-def {:keys [name doc function] :as method-data})

get-attrclj

(get-attr pyobj attr-name)

has-attr?clj

(has-attr? pyobj attr-name)

increfclj

(incref pyobj)

Incref and return object

Incref and return object
raw docstring

incref-wrap-pyobjectclj

(incref-wrap-pyobject pyobj)

Increment the object's refcount and then call wrap-pyobject. Used for borrowed references that need to escape the current scope.

Increment the object's refcount and then call wrap-pyobject.  Used for borrowed
references that need to escape the current scope.
raw docstring

method-def-data->method-defclj

(method-def-data->method-def method-data)

numpy-scalar->jvmclj

(numpy-scalar->jvm pyobj)

obj-get-itemclj

(obj-get-item elem elem-name)

obj-has-item?clj

(obj-has-item? elem elem-name)

obj-set-item!clj

(obj-set-item! elem elem-name elem-value)

py-dirclj

(py-dir pyobj)

py-falseclj

(py-false)

py-noneclj

(py-none)

py-not-implementedclj

(py-not-implemented)

py-raw-typeclj

(py-raw-type pyobj)

py-strclj

(py-str pyobj)

py-string->stringclj

(py-string->string pyobj)

py-trueclj

(py-true)

pyobj-true?clj

(pyobj-true? pyobj)

python->jvm-copy-hashmapclj

(python->jvm-copy-hashmap pyobj & [map-items])

python->jvm-copy-persistent-vectorclj

(python->jvm-copy-persistent-vector pyobj)

python->jvm-iterableclj

(python->jvm-iterable pyobj & [item-conversion-fn])

Create an iterable that auto-copies what it iterates completely into the jvm. It maintains a reference to the python object, however, so this method isn't necessarily safe.

Create an iterable that auto-copies what it iterates completely into the jvm.  It
maintains a reference to the python object, however, so this method isn't necessarily
safe.
raw docstring

python->jvm-iteratorclj

(python->jvm-iterator iter-fn item-conversion-fn)

set-attr!clj

(set-attr! pyobj attr-name attr-value)

stringableclj

(stringable item)

stringable?clj

(stringable? item)

wrap-clojure-fnclj

(wrap-clojure-fn fn-obj)

wrap-pyobjectclj

(wrap-pyobject pyobj)

Wrap object such that when it is no longer accessible via the program decref is called. Used for new references. This is some of the meat of the issue, however, in that getting the two system's garbage collectors to play nice is kind of tough.

Wrap object such that when it is no longer accessible via the program decref is
called. Used for new references.  This is some of the meat of the issue, however,
in that getting the two system's garbage collectors to play nice is kind
of tough.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close