projects
/
linpy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2de9600
)
Better initialization of Rational
author
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Fri, 25 Jul 2014 04:52:24 +0000
(06:52 +0200)
committer
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Fri, 25 Jul 2014 04:52:24 +0000
(06:52 +0200)
pypol/linexprs.py
patch
|
blob
|
history
diff --git
a/pypol/linexprs.py
b/pypol/linexprs.py
index
4fa8ed1
..
07d4005
100644
(file)
--- a/
pypol/linexprs.py
+++ b/
pypol/linexprs.py
@@
-413,11
+413,13
@@
def symbols(names):
class Rational(Expression, Fraction):
def __new__(cls, numerator=0, denominator=None):
- self =
Fraction.__new__(cls, numerator, denominator
)
+ self =
object().__new__(cls
)
self._coefficients = {}
- self._constant = Fraction(
self
)
+ self._constant = Fraction(
numerator, denominator
)
self._symbols = ()
self._dimension = 0
+ self._numerator = self._constant.numerator
+ self._denominator = self._constant.denominator
return self
def __hash__(self):