On Dec 3, 2007 12:12 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> >> Sure. However, you could also use _testcapi.PY_SSIZE_T_MAX, or
> >> ctypes.sizeof(ctypes.py_object).
> >
> > Much less intuitive though.
>
> Actually, I find the ctypes version a more direct answer to the
> question "what is the address space?".

Also the more correct answer. :-)

It's just that I didn't even know about it -- and I suspect most users
would never think of it. OTOH most users will expect sys.maxint to be
2**63-1 on a 64-bit machine (never mind that they are wrong for Win64
:-).

> >> I'd be in favor of the latter. I never meant the PyInt_CheckExact hack
> >> to persist into the release.
> >
> > OK. What's needed?
>
> The remaining occurrences of PyInt_CheckExact must be replaced with
> PyLong_Check, and the subsequent PyLong_AsLong calls must check for
> overflow. There are 22 uses still left. The ones in ceval.c are
> quite tricky: it's not clear that the speed-up they originally meant
> to provide is still present. The options would be to either continue
> special-casing small integers, or to remove the check altogether,
> trusting that the binary operator is fast enough (which may actually
> involve fewer function calls than the "inline" version).

I would remove the optimizations for now; we should benchmark again
later in the 3.0 beta release cycle. In general I'm all for removing
clutter that was once added in the hope of speeding things up; for 3.0
my main priority is correctness.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to