PyCQA / PyCQA/flake8-pyi

Y002 rejects "if x and (y or z)"

Open
#542 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.