From b046bdcc9044a88743a98bb06951f917edafae59 Mon Sep 17 00:00:00 2001 From: Vivien Maisonneuve Date: Sun, 13 Jul 2014 08:25:04 +0200 Subject: [PATCH 1/1] Improve error messages in linexprs.py --- pypol/linexprs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pypol/linexprs.py b/pypol/linexprs.py index e73449e..229e8d9 100644 --- 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): - raise TypeError('coefficients must be Rational instances') + raise TypeError('coefficients must be rational numbers') 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) -- 2.20.1