]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
For clarity, change _longobject to build directly from PyObject_VAR_HEAD
authorTim Peters <tim.peters@gmail.com>
Sat, 2 Mar 2002 04:33:09 +0000 (04:33 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 2 Mar 2002 04:33:09 +0000 (04:33 +0000)
instead of faking it by hand.  It *is* a var object, and nothing but
hysterical raisins to pretend it's an oddball.

Include/longintrepr.h

index 89ba5867e06f4a4ec3c6f2f0413ac30cd61eff19..abf86406840c1cd9165d0e1989180163604dcc1f 100644 (file)
@@ -36,11 +36,14 @@ typedef BASE_TWODIGITS_TYPE stwodigits; /* signed variant of twodigits */
    digit) is never zero.  Also, in all cases, for all valid i,
        0 <= ob_digit[i] <= MASK.
    The allocation function takes care of allocating extra memory
-   so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available. */
+   so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available.
+
+   CAUTION:  Generic code manipulating subtypes of PyVarObject has to
+   aware that longs abuse  ob_size's sign bit.
+*/
 
 struct _longobject {
-       PyObject_HEAD
-       int ob_size;
+       PyObject_VAR_HEAD
        digit ob_digit[1];
 };