[New-bugs-announce] [issue32284] typing.TextIO and BinaryIO are not aliases of IO[...]

Sebastian Rittau report at bugs.python.org
Mon Dec 11 19:34:35 EST 2017

New submission from Sebastian Rittau <srittau at rittau.biz>:

See https://github.com/python/typing/issues/518 for context.

The typing documentation for 3.6.4rc1 states:

> 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. This means that values of type IO[...], and especially IO[Any] can not be assigned where TextIO or BinaryIO is expected.

assignee: docs at python
components: Documentation
messages: 308083
nosy: docs at python, srittau
priority: normal
severity: normal
status: open
title: typing.TextIO and BinaryIO are not aliases of IO[...]
versions: Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list