]> CRI, Mines Paris - PSL - linpy.git/commitdiff
Simplify LinExpr.coefficients()
authorVivien Maisonneuve <v.maisonneuve@gmail.com>
Tue, 19 Aug 2014 12:35:14 +0000 (14:35 +0200)
committerVivien Maisonneuve <v.maisonneuve@gmail.com>
Tue, 19 Aug 2014 12:35:41 +0000 (14:35 +0200)
linpy/linexprs.py

index 99ad4ec3e162e36f5d6a5e855a19a47c2dca945a..ab5d344c8006d9394500ec74d741d2692db5e34d 100644 (file)
@@ -131,8 +131,7 @@ class LinExpr:
         Iterate over the pairs (symbol, value) of linear terms in the
         expression. The constant term is ignored.
         """
         Iterate over the pairs (symbol, value) of linear terms in the
         expression. The constant term is ignored.
         """
-        for symbol, coefficient in self._coefficients.items():
-            yield symbol, coefficient
+        yield from self._coefficients.items()
 
     @property
     def constant(self):
 
     @property
     def constant(self):