Introduce a protocol for `ZipFile.__init__`'s `file` parameter
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 2.1k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 82
Description
See https://github.com/python/typeshed/pull/10706#discussion_r1334909767
The file parameter in ZipFile.__init__ is typed as StrPath | IO[bytes]. IO[bytes] is incorrect here, but the correct protocol might be a bit complex and not something I feel like launching myself into right now. So I'm opening this issue so we don't forget.
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
Start with the linked typeshed pull request discussion and the stub entry for ZipFile.init; determine the protocol required for its file parameter and why IO[bytes] is incorrect. Done means replacing that annotation with the appropriate protocol while preserving support for StrPath and file-like inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100