printer.py
Print
dataclass
Bases: Output[Any]
Output that prints data on save. Mostly useful for debugging purposes.
The difference between other utilities like StringBuffer
and Pass
is
that Print
shows the output of the node directly on the console.
Example:
>>> from ordeq_common import Print, Static
>>> from ordeq import node, run
>>> @node(
... inputs=Static("hello, world!"),
... outputs=Print()
... )
... def print_message(message: str) -> str:
... return message.capitalize()
>>> result = run(print_message)
Hello, world!