pyd.references

Undocumented in source.

Members

Functions

findMatchingType
void findMatchingType(R range)
Undocumented in source. Be warned that the author may not have intended to support it.
get_d_reference
T get_d_reference(PyObject* _self)

Returns the object contained in a Python wrapped type.

get_python_reference
PyObject_BorrowedRef* get_python_reference(T t)

If the passed D reference has an existing Python object, return a borrowed reference to it. Otherwise, return null.

isConversionAddingFunctionAttributes
bool isConversionAddingFunctionAttributes(uint fromTypeFunctionAttributes, uint toTypeFunctionAttributes)
Undocumented in source. Be warned that the author may not have intended to support it.
remove_pyd_mapping
void remove_pyd_mapping(PyObject* self)
Undocumented in source. Be warned that the author may not have intended to support it.
set_pyd_mapping
void set_pyd_mapping(PyObject* _self, T t)
Undocumented in source. Be warned that the author may not have intended to support it.
wrap_d_object
PyObject* wrap_d_object(T t, PyTypeObject* type)

Returns a new Python object of a wrapped type.

Structs

DClass_Py_Mapping
struct DClass_Py_Mapping
Undocumented in source.
DDg_Py_Mapping
struct DDg_Py_Mapping
Undocumented in source.
DFn_Py_Mapping
struct DFn_Py_Mapping
Undocumented in source.
DStruct_Py_Mapping
struct DStruct_Py_Mapping
Undocumented in source.

Templates

FnHasRefParams
template FnHasRefParams(Fn)
Undocumented in source.
IsRefParam
template IsRefParam(alias p)
Undocumented in source.
PydTypeObject
template PydTypeObject(T)

_

is_wrapped
template is_wrapped(T)

A useful check for whether a given class has been wrapped. Mainly used by the conversion functions (see make_object.d), but possibly useful elsewhere.

pyd_references
template pyd_references(T)
Undocumented in source.
reference_container
template reference_container(Mapping)

A bidirectional mapping of a pyobject and the d object associated to it. On the python side, these are weak references; we don't want to prevent python from reclaiming objects it is finished with. As such, on the D side, if you take PyObject*s out of here and store them for an extended time elsewhere, be sure to increment the reference count. On the D side, we have strong references, but that is incidental to the GC. If you stick d objects not allocated with the GC, there will probably be leaks. We use malloc for the container's structure because we can't use the GC inside a destructor and we need to use this container there.

Meta