Skip to content

mypy reports invalid syntax with validators/rules/overlapping_fields_can_be_merged.py:344 #263

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

Closed
achimnol opened this issue Jan 24, 2020 · 5 comments

Comments

@achimnol
Copy link

achimnol commented Jan 24, 2020

The line 344 and 345 in overlapping_fields_can_be_merged.py causes mypy 0.761 to report invalid syntax error during type checks.

My program with graphql-core runs just fine at runtime and in fact those lines are in a valid Python syntax though look strange (orphaned expressions).

But I think if they aren't intended codes, then I'd like to suggest to fix them.

Here is the CI report link.

@achimnol
Copy link
Author

This might be related to python/mypy#8218.

Cito added a commit that referenced this issue Jan 24, 2020
Interestingly, they appear as syntax error with mypy
in Python 3.8, but not in Python 3.7.
We should officially support Python 3.8 when gevent 1.5
is available (currently Python 3.8 is not yet supported).
@Cito
Copy link
Member

Cito commented Jan 24, 2020

Thank you for reporting this @achimnol. I believe these two lines have been accidentally copied into the code when Syrus added the type hints, since these serve no purpose as you already noticed.

I have removed the lines now completely. Interestingly, they were not detected by our CI. I found the difference was that your CI is using Python 3.8 and ours Python 3.7. It seems mypy behaves differently depending on the Python version.

@Cito Cito closed this as completed Jan 24, 2020
@benhowes
Copy link

benhowes commented Jan 24, 2020

Would it be possible to get a release of this please 🙏

And thanks so much for resolving so quickly!

@Cito
Copy link
Member

Cito commented Jan 24, 2020

New release 2.3.1 with this and a few other minor fixes is out now. 😄

@achimnol
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants