IBM / pyflowgraph

Flow graphs for Python
Apache License 2.0
25 stars 8 forks source link

Use syntax to identify multiple return values #21

Closed epatters closed 5 years ago

epatters commented 5 years ago

Like many programming languages, Python treats function inputs and outputs asymmetrically. A function can have many arguments, but only one return value. Multiple return values are represented implicitly by returning a tuple. The system currently detects tuple return values and interprets them appropriately.

Unfortunately, not all Python functions respect the convention of returning tuples. For example, numpy.meshgrid returns a list of arrays, but in an expression like

xv, yv = np.meshgrid(x, y)

it is abundantly clear that we have a function call with two arguments and two (logical) return values. The system should use the syntax of multiple return values to identify them.