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

In PEP 484 type comments, allow text after "# type: ignore" #455

Merged
merged 2 commits into from
Aug 12, 2019

Conversation

msullivan
Copy link
Contributor

@msullivan msullivan commented Jul 19, 2019

This is to support allowing typecheckers to implement ignores for
specific errors, using syntax like # type: ignore=E1000 or
# type: ignore[type-mismatch] or some such.
mypy is about to add support for ignoring specific errors following
this design: python/mypy#7239

Support for extra text in type comments was implemented
in CPython as https://bugs.python.org/issue36878
and in typed_ast as python/typed_ast#116.

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! looks good

This is to support allowing typecheckers to implement ignores for
specific errors, using syntax like `# type: ignore=E1000` or
`# type: ignore[type-mismatch` or some such.
mypy is about to add support for ignoring specific errors following
this design: python/mypy#7239

Support for extra text in type comments was implemented
in CPython as https://bugs.python.org/issue36878
and in typed_ast as python/typed_ast#116.
Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sigmavirus24 sigmavirus24 merged commit fa92556 into PyCQA:master Aug 12, 2019
@msullivan msullivan deleted the nicer-type-ignore branch August 23, 2019 23:08
The-Compiler added a commit to qutebrowser/qutebrowser that referenced this pull request Sep 26, 2019
We can't use specific type ignores yet as there is no pyflakes release with
this change in: PyCQA/pyflakes#455
wsanchez added a commit to twisted/klein that referenced this pull request Oct 28, 2019
@wsanchez
Copy link

Any release planned so we can see this fix on PyPI?

@asottile
Copy link
Member

Any release planned so we can see this fix on PyPI?

not yet, please be patient (this comment is not productive) we'll release when we're ready!

wsanchez added a commit to python-hyper/hyperlink that referenced this pull request Nov 19, 2019
blueyed referenced this pull request in python/mypy Jan 15, 2020
This PR enables `--strict-equality` and `--show-error-codes` for self-check, and adds error codes in some `# type: ignore`s. So far this revealed two issues:
* Both PyCharm and flake8 get crazy about error codes, generating many false positives
* Error codes in `# type: ignore`s don't always work, see #7384
blueyed added a commit to blueyed/pytest that referenced this pull request Jan 15, 2020
blueyed added a commit to blueyed/pytest that referenced this pull request Jan 17, 2020
blueyed added a commit to blueyed/pytest that referenced this pull request Jan 17, 2020
blueyed added a commit to blueyed/pytest that referenced this pull request Jan 17, 2020
blueyed added a commit to blueyed/pytest that referenced this pull request Jan 17, 2020
@pipermerriam pipermerriam mentioned this pull request Jan 31, 2020
twm added a commit to twm/hyperlink that referenced this pull request Dec 22, 2020
twm added a commit to twm/hyperlink that referenced this pull request Dec 22, 2020
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

Successfully merging this pull request may close these issues.

None yet

4 participants