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. Christian _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com