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

mixed-case-variable-in-class-scope (N815) reports mixedCase on class variables of subclassed TypedDict #10671

Closed
teaishealthy opened this issue Mar 30, 2024 · 1 comment · Fixed by #10719
Assignees
Labels
multifile-analysis Requires analysis across multiple files

Comments

@teaishealthy
Copy link

Description

ruff 0.1.15

N815 will report on mixedCase class variables on subclasses of a TypedDict, while it won't on the actual TypedDict (as expected)

Minimal reproducible example

from typing import TypedDict

class A(TypedDict):
    mixedCase: int  # no error!

class B(A):
    alsoMixedCase: int  # Variable `alsoMixedCase` in class scope should not be mixedCase
@charliermarsh
Copy link
Member

We can only support this for subclasses defined in the same file right now.

@charliermarsh charliermarsh added the multifile-analysis Requires analysis across multiple files label Apr 1, 2024
@charliermarsh charliermarsh self-assigned this Apr 1, 2024
charliermarsh added a commit that referenced this issue Apr 1, 2024
## Summary

Only works within a single file for now.

Closes #10671.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multifile-analysis Requires analysis across multiple files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants