Errors may occur when converting Prolog terms to Python objects as
defined in section 2. These errors are
reported as
instantiation_error
, type_error(Type, Culprit)
or
domain_error(Domain, Culprit)
.
Defined domains are:
@(Constant)
, Constant is not true
,
false
or none
. For example, py_call(print(@error))
.py_call(m:f(1,x=2,3), R)
py_string_as(As)
option is invalid. For
example, py_call(m:f(), R, [py_string_as(codes)])
py_dict_as(As)
option is invalid. For
example, py_call(m:f(), R, [py_dict_as(list)])
py_call(m:f(point(1,2), R)
.Defined types are:
py_free(42)
fraction
instance is converted to a Prolog
rational number, but the textual conversion does not produce a valid
rational number. This can happen if the Python fraction
is
subclassed and the __str__()
method does not produce a
correct string.{k:v, ...}
representation for a dictionary we find
a term that is not a key-value pair. For example,
py_call(m:f({a:1, x}), R)
py_set(Elements)
, Elements is not a
list. For example, py_call(m:f(py_set(42), R)
.py_call(Target:FuncOrAttrOrMethod)
, Target is
not a module (atom) or Python object reference. For example, py_call(7:f(),
R)
.py_call(Target:FuncOrAttrOrMethod)
, FuncOrAttrOrMethod
is not an atom or compound. For example, py_call(m:7, R)
.