Skip to content

typing.no_type_check decorator is not being considered #595

Description

@liiight

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):

from uplink import Consumer, get, Path, Query
from typing import no_type_check


class GitHub(Consumer):
    """A Python Client for the GitHub API."""
    @get("users/{user}/repos")
    @no_type_check
    def get_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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions