[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2019-12-28 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with Pablo's analysis. And this can't be backported, since it's a new feature. So I'm closing this issue. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2019-12-28 Thread Kay Hayen
Kay Hayen added the comment: Thanks a lot, Batuhan, this will feel a lot more correct, from my point of view, this could be closed unless there would be a backport. -- ___ Python tracker

[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2019-12-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I don't think this is a bug. Technically the 'from __future__ import annotations' is a compiler option, not an AST one. Also, the flag says that "annotations become strings at runtime" and at the point, we have an AST is not still runtime. The

[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2019-12-27 Thread Batuhan
Batuhan added the comment: > Having a real "ast.unparse" would be better however. It seems that the > building blocks are all there, just not in that form. Now we have that :) https://docs.python.org/3.9/whatsnew/3.9.html#improved-modules -- ___

[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2019-11-17 Thread Batuhan
Batuhan added the comment: Hey @lukasz.langa, I want to work on this. Should we add an interface to _PyAST_ExprAsUnicode or just the bugfix for annotations? -- nosy: +BTaskaya, benjamin.peterson ___ Python tracker

[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2018-11-14 Thread Łukasz Langa
Łukasz Langa added the comment: I think this is a bug, actually. It's going to be an incompatibility in `ast.parse` so we'll probably want to only enable it in Python 3.8. This should have stringified annotations: >>> p = ast.parse(""" ... from __future__ import annotations ... a: 1 ... """)