gh-108411: Make typing.IO/BinaryIO arguments positional-only (#142906)
`IO` is purported to be the type of the file objects returned by `open`. However, all methods on those objects take positional-only arguments, while `IO`'s methods are declared with regular arguments. As such, the file objects cannot actually be considered to implement `IO`. The same thing applies to `BinaryIO`. Fix this by adjusting the definition of these ABCs to match the file objects. This is technically a breaking change, but it is unlikely to actually break anything: * These methods should never be called at runtime, since they are abstract. Therefore, this should not cause any runtime errors. * In typeshed these arguments are already positional-only, so this should not cause any errors during typechecking either.
R
Roman Donchenko committed
f6ed7c0acbd9234226cab5cca12f9d312809103e
Parent: 9a1c70c
Committed by GitHub <noreply@github.com>
on 4/20/2026, 8:19:43 PM