ruff
ruff copied to clipboard
Handle single element cases in PYI016
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 https://github.com/PyCQA/flake8-pyi/issues/484
Test Plan
cargo test
Seems to have broken PYI055 pretty severely. The PYI041 failure seems like a false positive though!
Hi @tusharsadhwani. Could you help me understand what's left to do for this PR and if you plan to work on it?
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.
Thanks. Are you okay with me closing the PR or do you plan to look into this in the future?
It ended up being troublesome in the original flake8-pyi project as well, probably best to close it for now.
Thanks for the quick reply and for exploring an implementation of this rule.