-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Turn --fast-parser on by default #2734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Python 3.3 has a different error for print statements that are missing parens (from |
a79e4ea
to
f28329f
Compare
f28329f
to
3e7834e
Compare
@gvanrossum: This should be ready for review now! There's a lot of test output that's been changed -- let me know if there's some way I can make the review easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what's going on with the Python 3.3 Travis run?
|
||
[case testDoubleEncoding2] | ||
# Again the first cookie should be used and fail. | ||
# coding: uft8 | ||
# coding: utf8 | ||
[out] | ||
file:2: error: Unknown encoding 'uft8' | ||
|
||
[case testDoubleEncoding3] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why you had to delete this test and the next?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because they were wrong. Neither of them causes an error when run under Python 3, and when run under mypy with the fast parser there is correctly no error as well. I'll fix the output and add them back (but in parse.test because parse-errors.test can only contain errors).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Adding this test to parse.test fails because we purposefully assume most test cases are ascii in several places, and we mention "portability issues" as part of the reason. I'm going to omit these test cases for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the "portability issues" reason is a feeble excuse, UTF-8 as the default for Python 3 is universal. More likely either there's some code somewhere that doesn't encode/decode right, or it's hard to edit files with UTF-8 in them (I can agree with the latter). But it's fine.
@@ -988,12 +970,11 @@ MypyFile:1( | |||
NameExpr(z))))) | |||
|
|||
[case testNotAsBinaryOp] | |||
x not y # E: Parse error before "y" | |||
x not is y # E: Parse error before is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically you ought to add a separate test for x not is y
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -3,8 +3,7 @@ in 1 | |||
def f(): | |||
1 1 | |||
[out] | |||
main:1: error: Parse error before in | |||
main:3: error: Parse error before numeric literal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this test should be split into two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the test should probably just be deleted. It looks like it's supposed to test multiple syntax errors, which we will no longer display.
(See my first comment here for what's going on with Python 3.3. I think skipping that test for now is probably reasonable.) |
Since January 2017, it is now enabled by default and the only parser available. python/mypy#2734
Resolves #1353.
Depends on #2710, #2722, and #2730. The first new commit in this PR is "Make --fast-parser the default".