[issue4294] Macros for PyLong: sign, number of digits, fits in an int

Mark Dickinson report at bugs.python.org
Mon Nov 10 14:48:48 CET 2008


Mark Dickinson <dickinsm at gmail.com> added the comment:

Another thought:  macros that are going to be used elsewhere in Python 
(like the way you're using PyLong_SIGN in mathmodule.c) would probably
be better off in longobject.h.   The fewer places there are that have to 
include longintrepr.h, the easier it is to mess with the internal 
representation.

It's quite tempting to 'fix' _PyLong_AsScaledDouble to return e as the 
number of bits, rather than the number of digits;  then mathmodule.c 
wouldn't have to include longintrepr.h at all.

(And if marshal.c were also changed, to read and write integers as byte 
strings, we wouldn't need longintrepr.h anywhere any more!)

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4294>
_______________________________________


More information about the Python-bugs-list mailing list