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

Handle single element cases in PYI016 #11273

Closed
wants to merge 1 commit into from

Conversation

tusharsadhwani
Copy link
Contributor

Summary

For code like:

from typing import Union
x: Union[int, Union[int]]

PYI016 was not being raised, since the iterator was only matching on Tuples inside the Union[].

Same as PyCQA/flake8-pyi#484

Test Plan

cargo test

@tusharsadhwani tusharsadhwani marked this pull request as draft May 3, 2024 21:27
@tusharsadhwani
Copy link
Contributor Author

Seems to have broken PYI055 pretty severely. The PYI041 failure seems like a false positive though!

@zanieb zanieb self-requested a review May 4, 2024 01:45
@MichaReiser
Copy link
Member

Hi @tusharsadhwani. Could you help me understand what's left to do for this PR and if you plan to work on it?

@tusharsadhwani
Copy link
Contributor Author

Hey, from what I remember adding this test case and the implementation for it ended up breaking other lints, and I never got around to figuring out why the other lints broke.

@MichaReiser
Copy link
Member

Thanks. Are you okay with me closing the PR or do you plan to look into this in the future?

@tusharsadhwani
Copy link
Contributor Author

It ended up being troublesome in the original flake8-pyi project as well, probably best to close it for now.

@MichaReiser
Copy link
Member

Thanks for the quick reply and for exploring an implementation of this rule.

@MichaReiser MichaReiser closed this Sep 8, 2024
@tusharsadhwani tusharsadhwani deleted the bug-pyi016 branch September 8, 2024 19:45
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.

2 participants