From: Vivien Maisonneuve Date: Tue, 19 Aug 2014 09:23:58 +0000 (+0200) Subject: Make LinExpr.coefficient() always return a Fraction X-Git-Tag: 1.0~59 X-Git-Url: https://scm.cri.mines-paristech.fr/git/linpy.git/commitdiff_plain/b90f09da753f9c6b865d866bc4ef9097f1b763ac?ds=inline Make LinExpr.coefficient() always return a Fraction --- diff --git a/linpy/linexprs.py b/linpy/linexprs.py index b2cec53..99ad4ec 100644 --- a/linpy/linexprs.py +++ b/linpy/linexprs.py @@ -122,7 +122,7 @@ class LinExpr: """ if not isinstance(symbol, Symbol): raise TypeError('symbol must be a Symbol instance') - return self._coefficients.get(symbol, 0) + return self._coefficients.get(symbol, Fraction(0)) __getitem__ = coefficient