Skip to content

Name 'typing.io.IO' is not defined #4639

Closed
@FichteFoll

Description

@FichteFoll

The Python 3.5 docs list a typing.io something ("wrapper namespace" according to docs, class according to interpreter), which you can access with IO to get an IO type, or for example TextIO. Using this in an interpreter works fine, but mypy complains about this.

>>> typing.io.IO[str]
typing.IO[str]
>>> typing.io.TextIO
typing.TextIO[str]
prettify.py:40: error: Name 'typing.io.IO' is not defined

I understand (now) that typing.IO is also possible, but the docs are very vague about that being a possibility, which is why I didn't even try it. Docs aside, since this works in the interpreter I think it should also work in mypy, which is why I'm reporting it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions