Implements the __repr__ built-in on the QCProtocol class in qc/protocols, to produce a specification string.
A new function parse_protocol_spec can break down the specification string to provide the arguments required to recover the parent instance, for example:
Alternatively a new classmethod from_specification of the QCProtocol class can create an instance directly from a protocol specification string, for example:
>>> p = QCProtocol(...)
>>> q = QCProtocol.from_specification(repr(p))
The PR also implements the __eq__ built-in on QCProtocol, so it's possible to check if two instances are equivalent.
Implements the
__repr__
built-in on theQCProtocol
class inqc/protocols
, to produce a specification string.A new function
parse_protocol_spec
can break down the specification string to provide the arguments required to recover the parent instance, for example:Alternatively a new classmethod
from_specification
of theQCProtocol
class can create an instance directly from a protocol specification string, for example:The PR also implements the
__eq__
built-in onQCProtocol
, so it's possible to check if two instances are equivalent.