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

False positive: non-lowercase-variable-in-function (N806) for a type alias #8773

Closed
Tinche opened this issue Nov 20, 2023 · 2 comments · Fixed by #8785
Closed

False positive: non-lowercase-variable-in-function (N806) for a type alias #8773

Tinche opened this issue Nov 20, 2023 · 2 comments · Fixed by #8785
Assignees
Labels
bug Something isn't working

Comments

@Tinche
Copy link

Tinche commented Nov 20, 2023

Howdy, this might be an easy one.

Using PEP 695 type aliases seems to trigger N806.

def f() -> None:
    type MyInt = int

Setting aside that type aliases might be less common on the function level, I don't think this should trigger N806.

@charliermarsh charliermarsh added the bug Something isn't working label Nov 20, 2023
@charliermarsh
Copy link
Member

Thanks!

@charliermarsh charliermarsh self-assigned this Nov 20, 2023
charliermarsh added a commit that referenced this issue Nov 20, 2023
Allow, e.g.:

```python
def func():
    type MyInt = int
```

(We already allowed `MyInt: TypeAlias = int`.)

Closes #8773.
@Tinche
Copy link
Author

Tinche commented Nov 20, 2023

Damn that's fast! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants