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:
2bad374
)
Improve error messages in linexprs.py
author
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Sun, 13 Jul 2014 06:25:04 +0000
(08:25 +0200)
committer
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Sun, 13 Jul 2014 06:25:04 +0000
(08:25 +0200)
pypol/linexprs.py
patch
|
blob
|
history
diff --git
a/pypol/linexprs.py
b/pypol/linexprs.py
index
e73449e
..
229e8d9
100644
(file)
--- a/
pypol/linexprs.py
+++ b/
pypol/linexprs.py
@@
-44,11
+44,11
@@
class Expression:
if not isinstance(symbol, Symbol):
raise TypeError('symbols must be Symbol instances')
if not isinstance(coefficient, numbers.Rational):
if not isinstance(symbol, Symbol):
raise TypeError('symbols must be Symbol instances')
if not isinstance(coefficient, numbers.Rational):
- raise TypeError('coefficients must be
Rational instance
s')
+ raise TypeError('coefficients must be
rational number
s')
coefficients = [(symbol, Fraction(coefficient))
for symbol, coefficient in coefficients if coefficient != 0]
if not isinstance(constant, numbers.Rational):
coefficients = [(symbol, Fraction(coefficient))
for symbol, coefficient in coefficients if coefficient != 0]
if not isinstance(constant, numbers.Rational):
- raise TypeError('constant must be a
Rational instance
')
+ raise TypeError('constant must be a
rational number
')
constant = Fraction(constant)
if len(coefficients) == 0:
return Rational(constant)
constant = Fraction(constant)
if len(coefficients) == 0:
return Rational(constant)