[issue5303] Use base 2**30 for Python longs, when possible
Martin v. Löwis
report at bugs.python.org
Tue Feb 17 23:39:21 CET 2009
New submission from Martin v. Löwis <martin at v.loewis.de>:
File Doc/library/sys.rst (right):
Line 418: A struct sequence that holds information about Python's
I don't think the sequence interface is really important here. There
should be a way to easily define regular struct-like classes (with no
sequence interface). Perhaps structseq could be modified to drop
sequence interface, and new structseqs should turn it off usually.
File Include/longintrepr.h (right):
Line 24: Furthermore, NSMALLNEGINTS and NSMALLPOSINTS should fit in a
Merge the comments into a single on. There is no need to preserve the
evolution of the code in the comment structure.
File Objects/longobject.c (right):
Line 2872: /* XXX benchmark this! Is is worth keeping? */
Why not PyLong_FromLongLong if available (no special case if not)?
File PC/pyconfig.h (right):
Line 318: #define PY_UINT64_T unsigned __int64
I think this should use PY_LONG_LONG, to support MingW32; likewise,
__int32 shouldn't be used, as it is MSC specific
File Python/marshal.c (right):
Line 160: w_long((long)(Py_SIZE(ob) > 0 ? l : -l), p);
This needs to deal with overflow (sizeof(size_t) > sizeof(long))
Line 540: if (n < -INT_MAX || n > INT_MAX)
I think this is obsolete now; longs can have up to ssize_t_max digits.
File configure.in (right):
Line 3132: # determine what size digit to use for Python's longs
I'm skeptical (-0) that we really need to have such a configure option.
File pyconfig.h.in (left):
Line 9: #undef AC_APPLE_UNIVERSAL_BUILD
We should find out why this is gone.
Line 958: /* Enable extensions on AIX 3, Interix. */
Likewise, this needs to be preserved.
Line 1017: /* Define WORDS_BIGENDIAN to 1 if your processor stores words
with the most
This also needs to be preserved.
nosy: loewis, marketdickinson
title: Use base 2**30 for Python longs, when possible
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list