Skip to content
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

Parser gives "inconsistent indentation" errors when it cannot parse an annotation #285

Closed
gvanrossum opened this issue Jul 14, 2014 · 1 comment
Labels
bug mypy got something wrong topic-parser

Comments

@gvanrossum
Copy link
Member

Example: for these three lines::

import typing
def foo(x: (int, str)) -> int:
    return int(x)

I get these errors::

x.py: In function "foo":
x.py, line 2: Parse error before (
x.py, line 2: Parse error before "int"
x.py: At top level:
x.py, line 2: Parse error before :
x.py, line 3: Inconsistent indentation
x.py, line 4: Inconsistent indentation
@gvanrossum
Copy link
Member Author

This now gives error: Invalid tuple literal type which I believe is as good as it needs to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-parser
Projects
None yet
Development

No branches or pull requests

2 participants