bpo-35766: Merge typed_ast back into CPython by gvanrossum · Pull Request #11645 · python/cpython
Demo: `compile(sample, "<sample>", "exec", PyCF_ONLY_AST|0x1000)` This will crash if type comments are present. It doesn't *work* yet -- type comments cause crashes in ast.c and type ignore comments aren't passed on to Module yet.
This fixes if 1: foo() but does nothing about def f(): foo() The latter still reports 'SyntaxError: invalid syntax'. So this is not a real solution, just a stop-gap measure until I find a better solution.
ambv approved these changes Jan 31, 2019
tyomitch added a commit to tyomitch/cpython that referenced this pull request
Feb 5, 2019pythonGH-11645 added the fourth option for `mode` argument; updating the comment accordingly.
msullivan added a commit to python/typed_ast that referenced this pull request
Feb 6, 2019This is mostly cribbed from python/cpython#11645, though it also adds a new error check to new_type_comment itself.
gvanrossum pushed a commit to python/typed_ast that referenced this pull request
Feb 6, 2019This is mostly cribbed from python/cpython#11645, though it also adds a new error check to new_type_comment itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters