projects
/
linpy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b02f955
)
Make LinExpr.coefficient() always return a Fraction
author
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Tue, 19 Aug 2014 09:23:58 +0000
(11:23 +0200)
committer
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Tue, 19 Aug 2014 09:25:15 +0000
(11:25 +0200)
linpy/linexprs.py
patch
|
blob
|
history
diff --git
a/linpy/linexprs.py
b/linpy/linexprs.py
index
b2cec53
..
99ad4ec
100644
(file)
--- 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')
"""
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
__getitem__ = coefficient