fixedpoint.py vs Python 2.1

Robin Becker robin at jessikat.fsnet.co.uk
Thu Apr 17 09:25:35 EDT 2003


I'm having a bit of difficulty with the fixedpoint module in Python 2.1.

I get the following error

Python 2.1.3 (#35, Apr  8 2002, 17:47:50) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> from fixedpoint import FixedPoint as fp
>>> fp(fp(.175,3)*fp(22,2),2)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "fixedpoint.py", line 368, in __mul__
    return _mkFP(self._roundquotient(n1 * n2, _tento(p)), p, type(self))
  File "fixedpoint.py", line 497, in _mkFP
    f = FixedPoint()
TypeError: object of type 'type' is not callable
>>>

is there some reason for passing type(self) around rather than
self.__class__ etc. 
-- 
Robin Becker




More information about the Python-list mailing list