[issue25885] ast Str type does not annotate the string type when it parses a python document

Myron Walker report at bugs.python.org
Wed Dec 16 16:50:51 EST 2015


Myron Walker added the comment:

The purpose of a syntax tree is to represent the syntax and not a final processed result of processing of syntax.  The current information stored for strings is losing syntax information which seems to defeat the purpose of offering the information in a syntax tree.  I filed a separate bug because it is also combining strings and losing operators for string literals.

   "Hello" + " World"

>From the looks of the code, the above would result in one string type with "Hello World" and syntax information associated with the operator would be lost.

And as indicated, string type information is being lost as well.  The user of the AST then has no way of getting the lost syntax information back once it is lost.

----------
components: +Interpreter Core -Extension Modules, Library (Lib)

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25885>
_______________________________________


More information about the Python-bugs-list mailing list