R
Robert Brewer
Consider the following:
PythonWin 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)]
on win32.
Portions Copyright 1994-2001 Mark Hammond ([email protected]) -
see 'Help/About PythonWin' for further copyright information.
File "<interactive input>", line 1, in ?
ValueError: list.index(x): x not in list
....so far, this is normal and expected.
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "C:\Python23\Lib\fixedpoint.py", line 316, in __cmp__
xn, yn, p = _norm(self, other, FixedPoint=type(self))
File "C:\Python23\Lib\fixedpoint.py", line 482, in _norm
y = FixedPoint(y, x.p)
File "C:\Python23\Lib\fixedpoint.py", line 255, in __init__
raise TypeError("can't convert to FixedPoint: " + `value`)
TypeError: can't convert to FixedPoint: None
Mmrph! I could fix this by:
1. Iterating through "bunch" by hand and trapping TypeError,
2. Overriding or hacking the __cmp__ function in fixedpoint, or
3. Overriding or hacking the _norm function in fixedpoint
The question is: given that there are multiple places to "fix" this,
where should I do so?
Robert Brewer
MIS
Amor Ministries
(e-mail address removed)
PythonWin 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)]
on win32.
Portions Copyright 1994-2001 Mark Hammond ([email protected]) -
see 'Help/About PythonWin' for further copyright information.
Traceback (most recent call last):import fixedpoint
a = fixedpoint.FixedPoint(3, 2)
bunch = [None, 12, a]
bunch.index(None) 0
bunch.index(12) 1
bunch.index(27)
File "<interactive input>", line 1, in ?
ValueError: list.index(x): x not in list
....so far, this is normal and expected.
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "C:\Python23\Lib\fixedpoint.py", line 316, in __cmp__
xn, yn, p = _norm(self, other, FixedPoint=type(self))
File "C:\Python23\Lib\fixedpoint.py", line 482, in _norm
y = FixedPoint(y, x.p)
File "C:\Python23\Lib\fixedpoint.py", line 255, in __init__
raise TypeError("can't convert to FixedPoint: " + `value`)
TypeError: can't convert to FixedPoint: None
Mmrph! I could fix this by:
1. Iterating through "bunch" by hand and trapping TypeError,
2. Overriding or hacking the __cmp__ function in fixedpoint, or
3. Overriding or hacking the _norm function in fixedpoint
The question is: given that there are multiple places to "fix" this,
where should I do so?
Robert Brewer
MIS
Amor Ministries
(e-mail address removed)