Neal Norwitz <[EMAIL PROTECTED]> added the comment: Interesting approach. I was surprised to see the change to the AST, but I understand why you did it. I think if the AST optimization approach works out well, we will want to have some more general mechanism to communicate these optimization (or other!) hints to the compiler. It would suck to have to modify the AST each time we wanted to add a new optimization. You and Tom might have better ideas for how best to achieve that.
I'll make some comments that would need to be addressed, but you might want to wait making any changes depending on what approach you decide to take. The most important missing piece is tests to show that the new code works. There are various whitespace issues. Both whitespace only changes that should be avoided and indentation inconsistencies with the existing code (or so it appears). The latter could be the way I'm viewing the file or existing problems with tabs. In Python/optimize.c, you need to handle the case where the PyDict_New() calls fail. It looks like currently an undetected error can happen in during construction. And on destruction it will crash because the objects will be NULL when calling Py_DECREF. All calls like PyDict_SetItem(), PyInt_FromLong(), etc need to handle errors. I'll need to study the code a lot more to see how well it behaves. Tests would help a lot with that. ---------- nosy: +nnorwitz _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4264> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com