Closed
Description
From python/mypy#338 -- not sure if this is still a good idea, but I'm moving all stubs-related mypy issues here if I'm not sure I can close them.
Currently the typing.IO[AnyStr] ABC only has operations that are valid for both binary and text files. This is sometimes awkward. Potentially add the entire file object interface to IO[AnyStr] so that IO[Any] supports both the text and binary file interfaces. We might then be able to get rid of TextIO and BinaryIO classes. This would simplify the programming model at the cost of some type checking precision. However, some code that is currently not statically typable would be (more) typable, so there might actually even be a net benefit in static typing precision.
Metadata
Metadata
Assignees
Labels
No labels