5.3 Janus class Term
Class janus.Term() encapsulates a Prolog term. Similarly to the Python object reference (see py_is_object/1), the class allows Python to represent arbitrary Prolog data, typically with the intend to pass it back to Prolog.
- Term janus.Term(...)
- Instances are never created explicitly by the user. An instance is
created by handling a term
prolog(Term)tho the data conversion processes. As a result, we can do?- py_call(janus:echo(prolog(hello(world))), Obj, [py_object(true)]). Obj = <py_Term>(0x7f7a14512050). ?- py_call(print($Obj)). hello(world) Obj = <py_Term>(0x7f7a14512050). - Term janus.Term.__str__()
- Return the output of print/1 on the term. This is what is used by the Python function print().
- Term janus.Term.__repr__()
- Return the output of write_canonical/1 on the term.