64-bit Python?

Martin v. Loewis martin at v.loewis.de
Thu Jun 6 09:21:35 CEST 2002


Mike Coleman <mkc+dated+1024627496.6928dd at mathdogs.com> writes:

> Has anyone looked at making Python 64-bit clean?

I believe the interpreter itself is 64-bit clean; the Alpha port has
been working for a long time.

> I was looking at trying to use the new mmap module to map in a large
> (>2G) file, and the comments in the source note that the mmap
> regions are limited to int-size (31 bits), primarily because Python
> objects are also limited to this size.

I don't think this is the case. Yes, Python objects are limited to
int-size - whether or not this means 31 bits depends on your 64-bit
platform. It appears that you have a specific 64-bit platform in mind,
where sizeof(int) is 4.

> Does anyone know if there's an inherent reason why it would be
> impossible or difficult to make Python 64-bit clean (say as a
> compilation option)?

I would not make it a compilation option. I think the best approach
would be to use size_t as the object size; that may potentially cause
problems in case people want to put negative numbers into the size.
Because of this problem, it might be appropriate to write a PEP.

Notice that this change does not make it "64-bit clean" - there still
might be other problems that nobody has noticed so far.

Regards,
Martin



More information about the Python-list mailing list