[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your patch Ivan. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8c83c23fa32405aa9212f028d234f4129d105a23 by Serhiy Storchaka (Ivan Levkivskyi) in branch 'master': bpo-28936: Detect lexically first syntax error first (#4097)

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-26 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Is it correct that the parameter can be annotated in the function body? I agree with Guido, this is rather a task for type checkers. -- ___ Python tracker

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-26 Thread Guido van Rossum
Guido van Rossum added the comment: Those seem things that the type checker should complain about, but I don't think Python should. -- ___ Python tracker

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is it correct that the parameter can be annotated in the function body? def f(x): x: int Or that the local variable can be annotated after assignment? def f(): x = 1 x: int --

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-24 Thread Guido van Rossum
Guido van Rossum added the comment: I think this is very minor but if you two can agree that the code is right I think it's a nice little improvement, and I like that that particular test's usefulness is restored. PS. Long-term we should really build error recovery into

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry for disturbing you Guido. I had added you as the committer of issue27999. Do you have thoughts about this issue? -- ___ Python tracker

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-24 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Am I needed here? As I understand, Serhiy is going to review the PR, so I think no. -- ___ Python tracker

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-23 Thread Guido van Rossum
Guido van Rossum added the comment: Am I needed here? -- nosy: -Jeremy.Hylton ___ Python tracker ___

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: OK, I made a PR with the fix and a test that checks the line number for syntax error (so that the original purpose test_global_err_then_warn is preserved). -- ___ Python tracker

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-23 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- pull_requests: +4068 stage: -> patch review ___ Python tracker ___

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do you mind to create a pull request Ivan? -- ___ Python tracker ___

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2016-12-17 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Updated patch as proposed by Serhiy. -- Added file: http://bugs.python.org/file45948/syntax-error-order-v2.patch ___ Python tracker

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2016-12-17 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I don't think this is a bug, but detecting first a SyntaxError that appears textually first might be seen as an improvement. I would say such behaviour seems more intuitive. A possible downside could be a (probably very minor) slow-down of compilation. I

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2016-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't know what should we do with this. Is there a bug that needs to be fixed? Or maybe the test can be just removed? -- ___ Python tracker

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2016-12-11 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Serhiy, here is a patch that might be helpful. It detects global-and-parameter errors sooner (when possible). This will cause the following: >>> if 1: ... def error(a): ... global a ... def error2(): ... b = 1 ... global b ...

[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2016-12-11 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Issue27999 invalidated test_global_err_then_warn in Lib/test/test_syntax.py:567. That test was added in issue763201 for testing that SyntaxWarning emitted in symtable_global() doesn't clobber a SyntaxError. In issue27999 a SyntaxWarning was converted to