Author nnorwitz
Recipients nnorwitz
Date 2008-03-25.06:15:43
SpamBayes Score 0.387646
Marked as misclassified No
Message-id <1206425748.68.0.392615437966.issue2477@psf.upfronthosting.co.za>
In-reply-to
Content
This is a patch that modifies the parser to allow getting the future
import flags into the AST.  There are 2 approaches that are embedded
within the patch.  Both approaches can be seen in Python/pythonrun.c.

1) update_flags_from_node() - this pulls the __future__ import out of
the parser nodes.  It is not complete, but should give an idea of how
this approach could be generalized.
2) Add APIS such as PyParser_ParseFileFlagsEx that returns the flags
from the parser

The first approach is somewhat fragile and kinda breaks encapsulation. 
It's nice that all the changes are internal and localized.

The second approach is probably a better long term solution, but adds
even more APIs where there are already too many.
History
Date User Action Args
2008-03-25 06:15:49nnorwitzsetspambayes_score: 0.387646 -> 0.387646
recipients: + nnorwitz
2008-03-25 06:15:48nnorwitzsetspambayes_score: 0.387646 -> 0.387646
messageid: <1206425748.68.0.392615437966.issue2477@psf.upfronthosting.co.za>
2008-03-25 06:15:47nnorwitzlinkissue2477 messages
2008-03-25 06:15:46nnorwitzcreate