title: TypeError: unsupported operand type(s) for -: 'generator' and 'NoneType'
body: <p>When trying to do a simple substraction Python gives me a typererror : TypeError: unsupported operand type(s) for -: 'generator' and 'NoneType'. In my idea the 2 sides are just numbers, so I do not understand the problem really. This is my code</p>
  
  <pre><code>m.addConstr(sum(x[i,j,t] for i in sub_nodes[z] for j in sub_nodes[z] if j&gt;i) &lt;=
              sum(y[i,t] for i in sub_nodes[z]) - max([y[k,t] for k in sub_nodes[z]]) 
                                                              for z in range(len(sub_nodes))
                                                              for t in periods)
  </code></pre>
  
  <p>It is about the minus in the second line. I am using the Gurobi solver. Has anyone an idea on how to make this code work?</p>