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

source

*object-reference-logging*clj

source

->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.)
sourceraw docstring

->py-dictclj

(->py-dict item)
source

->py-floatclj

(->py-float item)
source

->py-fnclj

(->py-fn fn-obj)
(->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.
sourceraw docstring

->py-listclj

(->py-list item-seq)
source

->py-longclj

(->py-long item)
source

->py-setclj

(->py-set item)
source

->py-stringclj

(->py-string item)
source

->py-tupleclj

(->py-tuple item-seq)
source

->pythonclj

(->python item & [options])

Completely convert a jvm object to a python copy.

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

apply-method-def-data!clj

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

get-attrclj

(get-attr pyobj attr-name)
source

has-attr?clj

(has-attr? pyobj attr-name)
source

increfclj

(incref pyobj)

Incref and return object

Incref and return object
sourceraw 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.
sourceraw docstring

method-def-data->method-defclj

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

numpy-scalar->jvmclj

(numpy-scalar->jvm pyobj)
source

obj-get-itemclj

(obj-get-item elem elem-name)
source

obj-has-item?clj

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

obj-set-item!clj

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

py-dirclj

(py-dir pyobj)
source

py-falseclj

(py-false)
source

py-noneclj

(py-none)
source

py-not-implementedclj

(py-not-implemented)
source

py-raw-typeclj

(py-raw-type pyobj)
source

py-strclj

(py-str pyobj)
source

py-string->stringclj

(py-string->string pyobj)
source

py-trueclj

(py-true)
source

pyobj-true?clj

(pyobj-true? pyobj)
source

python->jvm-copy-hashmapclj

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

python->jvm-copy-persistent-vectorclj

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

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.
sourceraw docstring

python->jvm-iteratorclj

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

set-attr!clj

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

stringableclj

(stringable item)
source

stringable?clj

(stringable? item)
source

wrap-clojure-fnclj

(wrap-clojure-fn fn-obj)
source

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.
sourceraw docstring

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

× close