How Python Implements "long integer"?

Pedram pm567426 at gmail.com
Mon Jul 6 08:24:43 EDT 2009


OK, fine, I read longobject.c at last! :)
I found that longobject is a structure like this:

struct _longobject {
    struct _object *_ob_next;
    struct _object *_ob_prev;
    Py_ssize_t ob_refcnt;
    struct _typeobject *ob_type;
    digit ob_digit[1];
}

And a digit is a 15-item array of C's unsigned short integers.
Am I right? Or I missed something! Is this structure is constant in
all environments (Linux, Windows, Mobiles, etc.)?



More information about the Python-list mailing list