[issue2477] parser support for future import of unicode_strings

Neal Norwitz report at bugs.python.org
Tue Mar 25 07:15:49 CET 2008


New submission from Neal Norwitz <nnorwitz at gmail.com>:

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 <report at bugs.python.org>
<http://bugs.python.org/issue2477>
__________________________________


More information about the Python-bugs-list mailing list