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

Detect nested Literal #425

Closed
Avasam opened this issue Oct 16, 2023 · 3 comments
Closed

Detect nested Literal #425

Avasam opened this issue Oct 16, 2023 · 3 comments

Comments

@Avasam
Copy link
Contributor

Avasam commented Oct 16, 2023

Y030 detects Literal["foo"] | Literal["bar"], but not Literal["foo", Literal["bar"]]
I think the above case should be detected. I don't think a new rule is needed (it feels pretty much in line with Y030, although it might then count as a breaking change)

@AlexWaygood
Copy link
Collaborator

Does this come up much? I'm not sure I've ever seen anybody try to add a nested Literal in typeshed. It might not be worth the added complexity to flake8-pyi's codebase to implement this

@Avasam
Copy link
Contributor Author

Avasam commented Oct 16, 2023

Does this come up much? I'm not sure I've ever seen anybody try to add a nested Literal in typeshed.

Not really, more of a "something I've noticed" whilst looking at PEP-586 so I'm bringing it up.

@AlexWaygood
Copy link
Collaborator

I think let's pass on this: I feel like the aim of flake8-pyi should be to flag common errors that often come up, and I'm not sure this falls into that bucket. But thanks for the feature suggestion! :D

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants