PyCQA / PyCQA/flake8-bugbear

Possible false positive for B015

Open
#152 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.1k
Forks
123
Avg merge
2d 5h
Merged PRs (30d)
5

Description

We discovered some potential false positives in pybind11 (see here) - specifically, a test like this reports:

with pytest.raises(TypeError):
    y < object()

Might not be fixable, and this check has helped in other cases, but thought I'd point it out here.

Contributor guide

No contributing guide indexed for this repository

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

Start by reproducing the B015 report using the pytest snippet and reviewing the rule's implementation and existing tests. Compare the behavior with the pybind11 example linked in the issue. Done means determining whether this is a valid false positive and, if fixable, adding coverage so this case is not incorrectly reported without breaking the other B015 cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.