On 9/8/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 9/8/07, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> wrote: > > I see that PyInt_* functions are aliases for PyLong_*. Which ones > > should I use for the long term? There are no PyInt equivalents of > > PyLong_FromLongLong nor PyLong_AsLongLong. > > Use PyLong for now. Eventually we may rename them all; then we'll > provide a renaming tool or macros. > > > Why is _PyLong_FitsInLong private? > > I don't know; perhaps because it doesn't always give the best answer. > > > In order to convert a Python3 int to > > another numeric representation, I would like to check if it fits in a C > > long, and convert via a string only if it does not. Should I use > > PyLong_AsLong + PyErr_Occurred? > > I think either is fine. _PyLong_FitsInLong() will only get better over time. > :-)
Speaking of PyLong, and its' minor awkwardness to work with in C (you either have to convert to another multiple-precision type through a string, or use Python's arithmetic operators directly), was there any thought given to using something like GPM's mpz_t as the backing data type? -- Nick _______________________________________________ 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