title: statsmodel GLM fit_constrained - object of type 'int' has no len()
body: <p>I'm using statsmodel to fit a GLM (Negative Binomial) and I want to add some constraints to the fit</p>
  
  <p>In the regression, there are five parameters involved: <code>a,b,c,d</code> and the constraint consists in <code>a+b=0</code></p>
  
  <p>The relevant code is the following:</p>
  
  <pre><code>model = sm.GLM(y_metrics, X, family=sm.families.NegativeBinomial(alpha=1))
  result = model.fit_constrained("a + b = 0")
  </code></pre>
  
  <p>but when I run the code I have the following error: </p>
  
  <pre><code>
       44 
       45         model = sm.GLM(y_metrics, X, family=sm.families.NegativeBinomial(alpha=1))
  ---&gt; 46         result = mod.fit_constrained("a + b = 0")
       47 
       48 
  
  ~/opt/anaconda3/lib/python3.7/site-packages/statsmodels/genmod/generalized_linear_model.py in fit_constrained(self, constraints, start_params, **fit_kwds)
     1345 
     1346         # same pattern as in base.LikelihoodModel.t_test
  -&gt; 1347         lc = DesignInfo(self.exog_names).linear_constraint(constraints)
     1348         R, q = lc.coefs, lc.constants
     1349 
  
  ~/opt/anaconda3/lib/python3.7/site-packages/patsy/design_info.py in linear_constraint(self, constraint_likes)
      534           di.linear_constraint("x1 = x2 = 3")
      535         """
  --&gt; 536         return linear_constraint(constraint_likes, self.column_names)
      537 
      538     def describe(self):
  
  ~/opt/anaconda3/lib/python3.7/site-packages/patsy/constraint.py in linear_constraint(constraint_like, variable_names)
      401             if not isinstance(code, str):
      402                 raise ValueError("expected a string, not %r" % (code,))
  --&gt; 403             tree = parse_constraint(code, variable_names)
      404             evaluator = _EvalConstraint(variable_names)
      405             constraints.append(evaluator.eval(tree, constraint=True))
  
  ~/opt/anaconda3/lib/python3.7/site-packages/patsy/constraint.py in parse_constraint(string, variable_names)
      235 
      236 def parse_constraint(string, variable_names):
  --&gt; 237     return infix_parse(_tokenize_constraint(string, variable_names),
      238                        _ops, _atomic)
      239 
  
  ~/opt/anaconda3/lib/python3.7/site-packages/patsy/constraint.py in _tokenize_constraint(string, variable_names)
      177 
      178     # Prefer long matches:
  --&gt; 179     variable_names = sorted(variable_names, key=len, reverse=True)
      180     variable_re = "|".join([re.escape(n) for n in variable_names])
      181 
  
  TypeError: object of type 'int' has no len()
  </code></pre>
  
  <p>Any idea why it is happening? 
  Thanks in advance </p>