This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hfuru
Recipients amaury.forgeotdarc, eric.araujo, hfuru, orsenthil, vstinner
Date 2010-11-09.09:54:43
SpamBayes Score 0.00025640684
Marked as misclassified No
Message-id <hbf.20101109vowk@bombur.uio.no>
In-reply-to <1289295899.43.0.275178242611.issue10359@psf.upfronthosting.co.za>
Content
STINNER Victor writes:
> Python-ast.c: why do you move req_name and req_type outside PyAST_obj2mod()?

Because there's no need to initialize the arrays each time PyAST_obj2mod
is called.  C90-friendly code inside PyAST_obj2mod would be

PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
{
    mod_ty res;
    static char *const req_name[] = {"Module", "Expression", "Interactive"};
    PyObject *req_type[];
    req_type[0] = (PyObject*)Module_type;
    req_type[1] = (PyObject*)Expression_type;
    req_type[2] = (PyObject*)Interactive_type;
    ...
}

which is what the current code actually executes.

(I moved req_name to keep it next to req_type in the code.)
History
Date User Action Args
2010-11-09 09:54:44hfurusetrecipients: + hfuru, amaury.forgeotdarc, orsenthil, vstinner, eric.araujo
2010-11-09 09:54:43hfurulinkissue10359 messages
2010-11-09 09:54:43hfurucreate