Liking cljdoc? Tell your friends :D

libpython-clj.python.protocols

Protocols to help generalize the python bindings. There is a clear distinction made between building a bridging type and thus allowing communication between the two systems and building a complete copy of the datastructure of one system in another. Generic objects must only bridge but if we know more about the object (like it implements java.util.Map) then we can implement either a bridge or a copy.

Atomic objects:

  • numbers
  • booleans
  • strings-convertible things like strings, keywords, symbols

Standard containers:

  • list
  • map
  • set
  • tuple (persistent vector of length less than 8)
Protocols to help generalize the python bindings.  There is a clear distinction
made between building a bridging type and thus allowing communication between the
two systems and building a complete copy of the datastructure of one system in
another.  Generic objects must only bridge but if we know more about the object
(like it implements java.util.Map) then we can implement either a bridge or a
copy.

Atomic objects:
* numbers
* booleans
* strings-convertible things like strings, keywords, symbols

Standard containers:
* list
* map
* set
* tuple (persistent vector of length less than 8)
raw docstring

callclj

(call callable & args)
source

call-attrclj

(call-attr item att-name & args)

Call an object attribute

Call an object attribute
sourceraw docstring

call-attr-kwclj

(call-attr-kw item att-name arglist kw-map)
source

call-kwclj

(call-kw callable arglist kw-args)
source

PBridgeToJVMcljprotocol

as-jvmclj

(as-jvm item options)

Return a pyobject implementation that wraps the python object.

Return a pyobject implementation that wraps the python object.
source

PBridgeToPythoncljprotocol

as-pythonclj

(as-python item options)

Aside from atom types, this means the object represented by a zero copy python mirror. May return nil. This convertible to pointers get converted to numpy implementations that share the backing store.

Aside from atom types, this means the object represented by a zero copy python
mirror.  May return nil.  This convertible to pointers get converted
to numpy implementations that share the backing store.
source

PCopyToJVMcljprotocol

->jvmclj

(->jvm item options)

Copy the python object into the jvm leaving no references. This not copying are converted into a {:type :pyobject-address} pairs.

Copy the python object into the jvm leaving no references.  This not copying
are converted into a {:type :pyobject-address} pairs.
source

PCopyToPythoncljprotocol

->pythonclj

(->python item options)

Copy this item into a python representation. Must never return nil. Items may fallback to as-python if copying is untenable.

Copy this item into a python representation.  Must never return nil.
Items may fallback to as-python if copying is untenable.
source

PJvmToNumpycljprotocol

->numpyclj

(->numpy item options)

Never return nil. Copy or otherwise, numpy or bust.

Never return nil.  Copy or otherwise, numpy or bust.
source

PJvmToNumpyBridgecljprotocol

as-numpyclj

(as-numpy item options)

Never copy data, operation returns nil of would require copy.

Never copy data, operation returns nil of would require copy.
source

PPyAttMapcljprotocol

att-type-mapclj

(att-type-map item)

Get hashmap of att name to keyword datatype.

Get hashmap of att name to keyword datatype.
source

PPyObjectcljprotocol

callable?clj

(callable? item)

dirclj

(dir item)

Get sorted list of all attribute names.

Get sorted list of all attribute names.

get-attrclj

(get-attr item item-name)

get-itemclj

(get-item item item-name)

has-attr?clj

(has-attr? item item-name)

has-item?clj

(has-item? item item-name)

set-attr!clj

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

set-item!clj

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

PPyObjectBridgeToListcljprotocol

as-listclj

(as-list item)

Return a List implementation using getitem, setitem.

Return a List implementation using __getitem__, __setitem__.
source

PPyObjectBridgeToMapcljprotocol

as-mapclj

(as-map item)

Return a Map implementation using getitem, setitem. Note that it may be incomplete especially if the object has no 'keys' attribute.

Return a Map implementation using __getitem__, __setitem__.  Note that it may be
incomplete especially if the object has no 'keys' attribute.
source

PPyObjectBridgeToTensorcljprotocol

as-tensorclj

(as-tensor item)

Return a tech.v2.tensor object from the item that shares the data backing store.

Return a tech.v2.tensor object from the item that shares the data backing store.
source

PPyObjLengthcljprotocol

Call the len attribute.

Call the __len__ attribute.

lenclj

(len item)
sourceraw docstring

PPythonTypecljprotocol

get-python-typeclj

(get-python-type item)

Return a keyword that describes the python datatype of this object.

Return a keyword that describes the python datatype of this object.
source

PyCallcljprotocol

do-call-fnclj

(do-call-fn callable arglist kw-arg-map)
source

pyobject->jvmcljmultimethod

source

pyobject-as-jvmcljmultimethod

source

python-obj-iteratorcljmultimethod

Given a python object, produce an iterator. Python is fairly confused about what an iterator is or does, so some things require iteritems and some things require calling iter.

Given a python object, produce an iterator.  Python is fairly confused about
what an iterator is or does, so some things require iteritems and some things
require calling __iter__.
sourceraw docstring

python-typeclj

(python-type item)
source

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

× close