-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Wrong reported location for undefined references in f-strings #3562
Comments
@ambv you were working on something related to this, no? It was a CPython issue as I recall? Or was that a different issue related to f-strings? |
Yes, this is bpo-30465 and the fix is in python/cpython#1800 but I won't have time before July to finish it. |
The referenced patch/PR has been merged into master and the 3.6 branch, so hopefully this will be resolved with the next CPython release. |
The actual fix for mypy will happen when typed_ast is updated, which should be when the next Python version is released, but may be sooner. |
Also, this is an issue with typed_ast, so I am closing this. |
If it's fixed in master (or 3.6) upstream it can be fixed in typed_ast, there's no need to wait for a CPython release. But there needs to be a separate PR for typed_ast (it doesn't automatically get copied from CPython nor does it somehow invoke the CPython version). I opened an issue against typed_ast (python/typed_ast#56) to copy the fix there (but I'm not personally going to do the busy-work of creating the PR). |
Repro:
I get (mypy 0.520-dev):
I'd expect:
So, for references in built-in functions in f-strings, both line and column are wrong (line is always reported as being the 1st, so these messages become the first ones reported by mypy) and for plain references in f-strings, just the reported column is wrong. Hope this helps.
The text was updated successfully, but these errors were encountered: