-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
stubs: false positiveType checkers report false errorsType checkers report false errorstopic: ioI/O related issuesI/O related issues
Description
Bug Report
It is typical to initialize an io.BufferedRWPair with the returns of Path.open() (in binary mode) as the arguments, and this works as expected.
BufferedRWPair(
Path('readfrom.dat').open('rb'),
Path('writeto.dat').open('wb')
)To Reproduce
Expected Behavior
Type checking should pass.
Actual Behavior
The type checking fails with:
error: Argument 1 to "BufferedRWPair" has incompatible type "BufferedReader"; expected "RawIOBase" [arg-type]
error: Argument 2 to "BufferedRWPair" has incompatible type "BufferedWriter"; expected "RawIOBase" [arg-type]
Your Environment
- Mypy version used: 1.15.0
- Mypy command-line flags:
- Mypy configuration options from
mypy.ini(and other config files):
[tool.mypy]
strict = true
- Python version used: 3.13
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stubs: false positiveType checkers report false errorsType checkers report false errorstopic: ioI/O related issuesI/O related issues