In article <6f6be2b9-49f4-4db0-9c21-52062d8ea...@l31g2000yqb.googlegroups.com>,
Pedram  <pm567...@gmail.com> wrote:
>
>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?

Look in the code to find out what PyObject_InitVar() does -- and, more
importantly, what its signature is.  The clue you're missing is the
trailing backslash on the third line, but that should not be required if
you're using an editor that shows you matching parentheses.
-- 
Aahz (a...@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"as long as we like the same operating system, things are cool." --piranha
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to