fixedpoint.py vs Python 2.1
Robin Becker
robin at jessikat.fsnet.co.uk
Thu Apr 17 13:14:54 EDT 2003
In article <mailman.1050594427.26198.python-list at python.org>, Tim Peters
<tim.one at comcast.net> writes
.....
>
>Find a version of the code that predates the SF one, and it won't have this
>problem (it didn't originally use type(self) or self.__class__).
>
>I don't know whether the SF folks intended to support Pythons earlier than
>2.2.
>
>
well I looked at the one referred to by the SF page at
http://fixedpoint.sourceforge.net/TimsMessage.txt
ie
http://starship.python.net/crew/aahz/FixedPoint.py
and it seems quite a number of changes were made since then. In
particular _mkFP is passed the constructor attributes rather than a
class constructor.
Starting with the SF one I replaced the usage of type(self) referring to
the current instance class with self.__class__ and that seems to
work.....,
but I'm not sure if type(instance) is exactly equivalent to
instance.__class__ in 2.2 so could be missing something.
--
Robin Becker
More information about the Python-list
mailing list