New submission from Neal Norwitz <[EMAIL PROTECTED]>: 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. ---------- components: Interpreter Core files: uni-strs.diff keywords: patch messages: 64458 nosy: nnorwitz priority: critical severity: normal status: open title: parser support for future import of unicode_strings versions: Python 2.6 Added file: http://bugs.python.org/file9844/uni-strs.diff __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2477> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com