Open mklingen opened 9 years ago
Hi, cpy does not support tuples grammar, you can use the tuple function to convert list to tuple:
c = 2;
d = 3;
a = tuple([1+c, 2+d]);
print a;
That's too bad, because it prevents cpy
from being able to interface with libraries that return multiple values. Consider a library that returns a tuple. In python, it would be as easy as:
(return_1, return_2) = library.function()
In cpy
, would we have to do this?
return_tuple = library.function();
return_1 = return_tuple[0];
return_2 = return_tuple[1];
If so, that's fine, but maybe it should be in the documentation.
The following expression does not work:
It gives the error:
Similarly, this:
gives the error:
What's the proper way of dealing with tuples in cpy?