What is difference between tuple and Tuple in PyGears python framework? pygears.org doesn't mention anything about it.
What is difference between tuple and Tuple in PyGears python framework? pygears.org doesn't mention anything about it.
tuple is Python syntax, while Tuple is PyGears syntax. When you want to send only one interface from your gear you have to use Tuple, while sending your data in many interfaces you use tuple.
Code example:
@gear
async def python_gear() -> (Uint[8], Uint[8]):
yield (1, 2)
@gear
async def pygears_gear() -> Tuple[Uint[8], Uint[8]]:
yield Tuple[1, 1]
pythons_res = []
pygears_res = []
@gear
def consumer():
pythons = python_gear()
pygears = pygears_gear()
collect(ccat(*pythons), result=pythons_res)
collect(pygears, result=pygears_res)
consumer()
sim()