Currently, protocols written in python end with print(protocol). This converts the protocol to a string, losing any potentially smart features of the steps. A better approach would be to provide something like protocol.print() that would output the protocol to a pickle if stdout isn't attached to a TTY. The implementation would be very simple:
class Protocol:
...
def print(self):
io = ProtocolIo(self)
io.to_stdout()
Currently, protocols written in python end with
print(protocol)
. This converts the protocol to a string, losing any potentially smart features of the steps. A better approach would be to provide something likeprotocol.print()
that would output the protocol to a pickle if stdout isn't attached to a TTY. The implementation would be very simple: