Skip to content

Fails with --silent-imports; passes without it #1364

Closed
@bdarnell

Description

@bdarnell
$ mypy -f tornado/ioloop.py
$ mypy -f -s tornado/ioloop.py
tornado/ioloop.py:48: error: Module has no attribute 'set_close_exec'
tornado/ioloop.py:48: error: Module has no attribute 'Waker'

In Tornado, I prefer to use inline annotations instead of stub files, but occasionally I use a stub for something that would be too tricky to mark up inline. In this case, a stub file imports and reexports definitions from a python file. With -s, python imports are silently ignored.

My suggestion would be to solve this by making -s apply only to imports that appear in .py files; imports in .pyi files would always be processed regardless of their target.

(Versions tested: tornadoweb/tornado@b69982477, ac193cf9dd, python/typeshed@68306484a)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions