[Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.h Modules/_sre.c Objects/abstract.c Objects/boolobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Obje

M.-A. Lemburg mal at egenix.com
Wed Aug 23 16:45:40 CEST 2006


Guido van Rossum wrote:
> On 8/23/06, M.-A. Lemburg <mal at egenix.com> wrote:
>> PyInts already have all the optimizations you have on your agenda for
>> PyLongs, so I wonder why you're trying to duplicate all this
>> work, instead of building upon it and adding the PyLong features
>> to PyInts. Maybe I'm missing something, but this looks like a much
>> more natural approach to me.
> 
> Since the PyLong implementation is nearly three times as large as the
> PyInt implementation, adding long functionality to ints would be the
> backwards thing to do.

I was actually thinking of adding the PyLong implementation
as special case to PyInts, ie. appending the digits array
to the PyInt struct and making PyInts VarObjects. A size 0
PyInt would then be the classical PyInt, a size n (n>0)
PyInt would work as a classical PyLong.

One could even use a union to save a sizeof(long) bytes in
the PyLong situation.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 23 2006)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-checkins mailing list