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 nnorwitz
Recipients nnorwitz, novalis_dt
Date 2008-11-06.07:45:48
SpamBayes Score 3.474998e-14
Marked as misclassified No
Message-id <1225957552.34.0.532210895597.issue4264@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-11-06 07:45:52nnorwitzsetrecipients: + nnorwitz, novalis_dt
2008-11-06 07:45:52nnorwitzsetmessageid: <1225957552.34.0.532210895597.issue4264@psf.upfronthosting.co.za>
2008-11-06 07:45:51nnorwitzlinkissue4264 messages
2008-11-06 07:45:48nnorwitzcreate