You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
typing.no_type_check decorator is not being considered #595
pyflakes does not seem to take into consideration the typing.no_type_check decorator and throws F821 undefined name error,
Example (from Uplink's documentation, a great library with a custom use case for type annotation):
fromuplinkimportConsumer, get, Path, Queryfromtypingimportno_type_checkclassGitHub(Consumer):
"""A Python Client for the GitHub API."""@get("users/{user}/repos")@no_type_checkdefget_repos(self, user: Path, sort_by: Query("sort")):
"""Get user's public repositories."""
Results of running pyflakes:
➜ pyflakes flake8_poc.py
flake8_poc.py:9:52 undefined name 'sort'
This raises no error when running using mypy for example.
we should still support this decorator I think, it's similar to the support for Annotation and there's already a context for disabling type annotation considering in pyflakes
Reacted by Ian Stapleton Cordasco and John Vandenberg
Activity
sigmavirus24 commentedon Nov 29, 2020
This is sort of a duplicate of #554. That
Queryannotation, as was already explained on Flake8's issue tracker, isn't valid PEP 484asottile commentedon Nov 29, 2020
we should still support this decorator I think, it's similar to the support for Annotation and there's already a context for disabling type annotation considering in pyflakes