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
PEP 484 forward references should be quoted? #180
Comments
We should probably follow the spec and quote. So far, it didn't matter much since both pytype and mypy can parse these as-is. But it's good to know that pycharm can't. |
Hm... While the PEP isn't very clear about this, the intention here is that
since stub files are not executable, the quoting there is unnecessary. So
maybe file this as a PyCharm bug?
|
The PyCharm bug I filed was closed citing the PEP ;) I'll reopen it. |
Would you mind linking to the IntelliJ issue here?
|
Thanks! Could you or anyone reading this submit a PR to edit the PEP to
make this unambiguous?
…--Guido (mobile)
|
Can do. |
Attached a patch to http://bugs.python.org/issue26982 |
I'm sorry, I don't like these edits much. They introduce an awkward forward Also, let's move this to the upstream GitHub repo I use for PEP 484 -- Thanks for giving it a try! On Sun, May 8, 2016 at 9:03 PM, James Tatum notifications@github.com
--Guido van Rossum (python.org/~guido) |
PEP 484 mentions that forward references should be quoted:
This convention doesn't seem to be followed in the typeshed stubs, for instance, from datetime:
Not sure whether the PEP is ambiguous (maybe this isn't necessary in stub files?) or whether this is an error. I realize mypy has no trouble parsing these, but I'm wondering about other type checkers. The latest version of PyCharm, for instance, cannot resolve a stub written this way (see https://youtrack.jetbrains.com/issue/PY-19374).
The text was updated successfully, but these errors were encountered: