[Python-Dev] Type of range object members

Guido van Rossum guido at python.org
Tue Aug 15 18:10:12 CEST 2006


On 8/15/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Guido van Rossum schrieb:
> > FWIW, I propose that in py3k, the int type uses Py_ssize_t instead of long.
>
> This is really a py3k issue, but: shouldn't the int and long types
> really get unified into a single type in Py3k?

>From the Python *user*'s perspective, yes, as much as possible. But
I'm still playing with the thought of having two implementation types,
since otherwise we'd have to devote 4 bytes (8 on a 64-bit platform)
to the single *bit* telling the difference between the two internal
representations. I haven't decided whether to make 'int' an abstract
base type and have 'short' and 'long' subtypes (perhaps using other
names), or whether to make 'int' the base type and 'short' the
subtype, or whether to cheat and hack type() so that type() of any
integer always returns int.  But in any case, this would mean that at
the C level the distinction continues to exist.

Maybe we can discuss this at the sprint next week?

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list