Hallvard B Furuseth <h.b.furus...@usit.uio.no> added the comment: 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.) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10359> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com