We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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?
to your account
Mypy should complain about code that isn't using string literal escaped when they are required:
def (self) -> A: ... # Should be an error; string literal escape required
Initially we could only detect these cases within a single module. A more general solution would also detect string literal types needed due to cyclic imports.
A simple implementation idea:
We also need deal with type aliases, but this isn't needed for the first iteration.
I think that somebody started working on this a while back, but I can't remember the details. Maybe there is an existing issue as well?
The text was updated successfully, but these errors were encountered:
PEP 563 is also relevant to this, making this only required when the annotations future import hasn't been made (at least for 3.7+).
Sorry, something went wrong.
Note that #9647 does this for use of PEP 604 syntax; it sets an "is_evaluated" attribute on UnionTypes that is False for type comments and string literal types.
No branches or pull requests