[Python-3000] Enough with the u"string" already!
nnorwitz at gmail.com
Tue Mar 25 07:18:21 CET 2008
On Mon, Mar 24, 2008 at 8:10 PM, Christian Heimes <lists at cheimes.de> wrote:
> Martin v. Löwis schrieb:
> >> Since 2.4 Python uses the AST tree to access the future flags. But the
> >> string unicode literals require the information before the AST tree is
> >> created.
> > "We" should have considered that 2.5 still had to support future
> > statements in the parser, for the with_statement, so I think this would
> > have been unnecessary.
> > Whoever implemented "from __future__ import print_function" knew about
> > that, and added it were it belongs (even though the function name
> > has the work "hack" in it).
> I tried to use the future_hack. However there is no way to access
> parser_state->p_flags in PyAST_FromNode(). I don't see a way to get the
> information from the parser into the AST code. The current API has no
> means to transfer the information. The flags option doesn't do the trick.
Two options exist here: http://bugs.python.org/issue2477
I have no plans to finish this patch off anytime soon. But this
should be enough to make further progress.
More information about the Python-3000