Y002 rejects "if x and (y or z)"
Open
Nobody has claimed this yet.
type-bug
- Dominant language
- Python
- Stars
- 83
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
I tried to write if sys.version_info >= (3, 15) and (sys.platform == "win32" or sys.platform == "linux"): in a stub (yay socket constants), but flake8-pyi wouldn't let me.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named; reproduce the reported Y002 case in a stub and trace the Y002 rule entry point. Done means the parenthesized and/or condition is accepted while the rule's other checks remain enforced, with a regression test for this example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100