Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-08 Thread Gregory P. Smith
heh ag On 12/7/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > > Gregory P. Smith wrote: > > look at the length of a > > hex pointer in the repr of a class for C pointer size. > > I don't think that will work, because the repr only uses > as many hex digits as it needs to represent the value: > > >>>

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-07 Thread Greg Ewing
Gregory P. Smith wrote: > look at the length of a > hex pointer in the repr of a class for C pointer size. I don't think that will work, because the repr only uses as many hex digits as it needs to represent the value: >>> o = object() >>> o I'm pretty sure my G4 PPC is using pointers longer

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-07 Thread Guido van Rossum
On Dec 7, 2007 11:23 AM, Christian Heimes <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > sys.maxsize should be backported to 2.6. > > It's on my todo list. But at first I'm going to celebrate Python 3.0a2 > with a beer and meet some friends. Enjoy! Me, I'm going on a conference bike with

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-07 Thread Christian Heimes
Guido van Rossum wrote: > sys.maxsize should be backported to 2.6. It's on my todo list. But at first I'm going to celebrate Python 3.0a2 with a beer and meet some friends. Christian ___ Python-3000 mailing list Python-3000@python.org http://mail.pyth

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-07 Thread Guido van Rossum
On Dec 7, 2007 11:06 AM, Gregory P. Smith <[EMAIL PROTECTED]> wrote: > On 12/3/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On Dec 2, 2007 12:56 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > > It's only used for sys.maxint. Do we still need sys.maxint and > > > > PyInt_GetMax()? IMO

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-07 Thread Gregory P. Smith
On 12/3/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On Dec 2, 2007 12:56 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > It's only used for sys.maxint. Do we still need sys.maxint and > > > PyInt_GetMax()? IMO PyLong_GetNativeMax() and sys.maxnativelong are > > > better names. > > >

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-05 Thread Thomas Heller
Jim Jewett schrieb: > On 12/3/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> 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 intuitiv

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-04 Thread Christian Heimes
Guido van Rossum wrote: > OK, with sys.maxsize as the logical replacement, it can go. Make sure > to fix everything that breaks before submitting though! I've removed sys.maxint and replaced sys.maxint with sys.maxsize. Does anybody see a problem with the Windows 64bit platform? AFAIK it's the onl

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-04 Thread Guido van Rossum
On Dec 4, 2007 11:21 AM, Christian Heimes <[EMAIL PROTECTED]> wrote: > Thomas Wouters wrote: > > The removal of classic slices already added sys.maxsize, which is the max of > > Py_ssize_t. > > Great. If I'm not mistaken the max of Py_ssize_t should be 2**31-1 on a > 32bit system and 2**63-1 on a 6

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-04 Thread Christian Heimes
Thomas Wouters wrote: > The removal of classic slices already added sys.maxsize, which is the max of > Py_ssize_t. Great. If I'm not mistaken the max of Py_ssize_t should be 2**31-1 on a 32bit system and 2**63-1 on a 64bit system, even on Win x64 and IA-64. Guido, it's your call. Should sys.maxin

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-04 Thread Thomas Wouters
On Dec 3, 2007 7:57 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On Dec 2, 2007 12:56 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > It's only used for sys.maxint. Do we still need sys.maxint and > > > PyInt_GetMax()? IMO PyLong_GetNativeMax() and sys.maxnativelong are > > > better na

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-04 Thread Guido van Rossum
On Dec 4, 2007 7:55 AM, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 12/3/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > 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(c

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-04 Thread Jim Jewett
On 12/3/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > 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 fi

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-03 Thread Guido van Rossum
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

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-03 Thread Martin v. Löwis
>> 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?". >> I'd be in favor of the latter. I never meant the PyInt_C

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-03 Thread Guido van Rossum
On Dec 3, 2007 11:34 AM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Actually it's still somewhat interesting to be able to tell whether a > > particular Python build uses 64-bit pointer or 32-bit pointers. (I > > realize sys.maxint doesn't quite tell us this, but on Linux at least > > it does

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-03 Thread Martin v. Löwis
> Actually it's still somewhat interesting to be able to tell whether a > particular Python build uses 64-bit pointer or 32-bit pointers. (I > realize sys.maxint doesn't quite tell us this, but on Linux at least > it does.) Sure. However, you could also use _testcapi.PY_SSIZE_T_MAX, or ctypes.siz

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-03 Thread Guido van Rossum
On Dec 2, 2007 12:56 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > It's only used for sys.maxint. Do we still need sys.maxint and > > PyInt_GetMax()? IMO PyLong_GetNativeMax() and sys.maxnativelong are > > better names. > > I think they should go entirely. They don't give any interesting > i

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-02 Thread Christian Heimes
Bill Janssen wrote: > So, now I can't build the 3K branch. > > This is on OS X 10.5.0, gcc 4.0.1, "make clean; make": > > /local/python/3k/src 75 % make > gcc -o python.exe \ > Modules/python.o \ > libpython3.0.a -ldl > Undefined symbols: > "_

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-02 Thread Bill Janssen
> A few hours ago I've renamed the remaining occurrences of PyInt_ to > PyLong_. Most PyInt_ were aliases for PyLong_ functions. I've also > removed the inclusion of intobject.h from Python.h but kept the file > with the aliases for porters from 2.x to 3.0. The remaining functions > are now in long

Re: [Python-3000] PyInt_ to PyLong_ rename

2007-12-02 Thread Martin v. Löwis
> longobject.h has still two PyInt_ functions: PyInt_GetMax and > PyInt_CheckExact. > > long > PyInt_GetMax(void) > { > return LONG_MAX;/* To initialize sys.maxint */ > } > It's only used for sys.maxint. Do we still need sys.maxint and > PyInt_GetMax()? IMO PyLong_GetNativeMax() an

[Python-3000] PyInt_ to PyLong_ rename

2007-12-02 Thread Christian Heimes
A few hours ago I've renamed the remaining occurrences of PyInt_ to PyLong_. Most PyInt_ were aliases for PyLong_ functions. I've also removed the inclusion of intobject.h from Python.h but kept the file with the aliases for porters from 2.x to 3.0. The remaining functions are now in longobject.h.