The typing documentation for 3.6.4rc1 at states:
This (typing.io) defines the generic type IO[AnyStr] and aliases TextIO and BinaryIO for respectively IO[str] and IO[bytes].
In the current implementation TextIO and BinaryIO are not aliases, but instead derived from IO. I am not sure whether this is a documentation or implementation problem, but the current implementation causes problems, since values of type IO[...], and especially IO[Any] can not be assigned where TextIO or BinaryIO is expected.
See python/typeshed#1780 for a real-world example.
The typing documentation for 3.6.4rc1 at states:
In the current implementation
TextIOandBinaryIOare not aliases, but instead derived fromIO. I am not sure whether this is a documentation or implementation problem, but the current implementation causes problems, since values of typeIO[...], and especiallyIO[Any]can not be assigned whereTextIOorBinaryIOis expected.See python/typeshed#1780 for a real-world example.