How Python Implements "long integer"?

Pedram pm567426 at
Sun Jul 5 12:01:30 EDT 2009

Hello again,
This time I have a simple C question!
As you know, _PyLong_New returns the result of PyObject_NEW_VAR. I
found PyObject_NEW_VAR in objimpl.h header file. But I can't
understand the last line :( Here's the code:

#define PyObject_NEW_VAR(type, typeobj, n) \
( (type *) PyObject_InitVar( \
      (PyVarObject *) PyObject_MALLOC(_PyObject_VAR_SIZE((typeobj),
(n)) ),\
      (typeobj), (n)) )

I know this will replace the PyObject_New_VAR(type, typeobj, n)
everywhere in the code and but I can't understand the last line, which
is just 'typeobj' and 'n'! What do they do? Are they make any sense in
allocation process?

More information about the Python-list mailing list