Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bdarnell opened this issue Apr 12, 2016 · 1 comment
Closed

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

bdarnell opened this issue Apr 12, 2016 · 1 comment
Labels

Comments

@bdarnell
Copy link
Contributor

$ 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)

@gvanrossum gvanrossum added this to the Undetermined priority milestone Apr 12, 2016
gvanrossum pushed a commit that referenced this issue Apr 13, 2016
Implement the idea in the issue by Ben Darnell.  (However, this
implementation still silences the case where main.py -> stub.pyi ->
x.py -> y.py. Hopefully that doesn't matter.)
@gvanrossum
Copy link
Member

gvanrossum commented Jul 21, 2017

Note that the feature requested here and implemented in #1372 was rolled back (over a year later) by #3738 after discussion in #3727.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants