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

Visit decorators before visiting the function definitions. #303

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

Carreau
Copy link
Collaborator

@Carreau Carreau commented Feb 13, 2024

They are not in the same scope and in the case we have something like.

    import param

    @dec(param)
    def func(param):
        param

This would lean to the false positive that param does not needs to be imported as the functions args definitions woudl be visited first.

Closes #265

They are not in the same scope and in the case we have something like.

```
    import param

    @dec(param)
    def func(param):
        param
```

This would lean to the false positive that `param` does not needs to be
imported as the functions args definitions woudl be visited first.
@Carreau Carreau merged commit 556b95c into deshaw:master Feb 13, 2024
6 checks passed
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.

tidy-imports incorrectly removes import when used in decorator and matches with a parameter name (PyInf#11068)
1 participant