PyCQA / PyCQA/flake8-pyi

Warn for IO types like io.BytesIO

Open
#463 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type-feature
Dominant language
Python
Stars
83
Forks
22
PR merge metrics
No merged PRs in 30d

Description

No warnings are raised for this:

from io import BytesIO


def open(fp: BytesIO):
    ...

Instead of the concrete io.BytesIO, this should probably be something more specific for what exactly the file-like object actually does, or possibly even typing.BinaryIO.

Similarly for other IO things.

Should flake8-pyi add some warnings in this area?

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

The issue does not name any files, tests, or entry points. First determine how flake8-pyi implements type-related warnings and how IO annotations such as io.BytesIO and typing.BinaryIO should be classified; done requires an agreed warning scope and corresponding tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.