Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generator expression must be parenthesized if not sole argument

I'm very new to Python and am trying to install the FuncDesigner package. It gives the following error:

Generator expression must be parenthesized if not sole argument and points to the following line:

kw = {'skipArrayCast':True} if isComplexArray else {}
r = ooPoint((v, x[S.oovar_indexes[i]:S.oovar_indexes[i+1]]) for i, v in enumerate(S._variables), **kw)

Any ideas what to change the line starting with "r = " to to get it to work?

I'm using a Python 3 version.

like image 336
Caleb Sandfort Avatar asked Oct 14 '15 23:10

Caleb Sandfort


1 Answers

... Put the genex in parens, just like the error tells you to.

r = ooPoint(((v, x[S.oovar_indexes[i]:S.oovar_indexes[i+1]]) for i, v in enumerate(S._variables)), **kw)
like image 144
Ignacio Vazquez-Abrams Avatar answered Sep 30 '22 16:09

Ignacio Vazquez-Abrams