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)

call-attrclj

(call-attr item att-name & args)

Call an object attribute

Call an object attribute
raw docstring

call-attr-kwclj

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

call-kwclj

(call-kw callable arglist kw-args)

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.

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.

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.

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.

PJvmToNumpycljprotocol

->numpyclj

(->numpy item options)

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

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

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.

PPyAttMapcljprotocol

att-type-mapclj

(att-type-map item)

Get hashmap of att name to keyword datatype.

Get hashmap of att name to keyword datatype.

PPyObjectcljprotocol

attrclj

(attr item item-name)

callable?clj

(callable? item)

dirclj

(dir item)

Get sorted list of all attribute names.

Get sorted list of all attribute names.

has-attr?clj

(has-attr? item item-name)

has-item?clj

(has-item? item item-name)

itemclj

(item item item-name)

set-attr!clj

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

set-item!clj

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

PPyObjectBridgeToListcljprotocol

as-listclj

(as-list item)

Return a List implementation using getitem, setitem.

Return a List implementation using __getitem__, __setitem__.

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.

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.

PPyObjLengthcljprotocol

Call the len attribute.

Call the __len__ attribute.

lenclj

(len item)
raw 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.

PyCallcljprotocol

do-call-fnclj

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

pyobject->jvmcljmultimethod


pyobject-as-jvmcljmultimethod


python-typeclj

(python-type item)

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

× close