Title: Fails with `--silent-imports`; passes without it · Issue #1364 · python/mypy · GitHub
Open Graph Title: Fails with `--silent-imports`; passes without it · Issue #1364 · python/mypy
X Title: Fails with `--silent-imports`; passes without it · Issue #1364 · python/mypy
Description: $ 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 ...
Open Graph Description: $ 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 Torn...
X Description: $ 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 'Wa...
Opengraph URL: https://github.com/python/mypy/issues/1364
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fails with `--silent-imports`; passes without it","articleBody":"```\n$ mypy -f tornado/ioloop.py\n$ mypy -f -s tornado/ioloop.py\ntornado/ioloop.py:48: error: Module has no attribute 'set_close_exec'\ntornado/ioloop.py:48: error: Module has no attribute 'Waker'\n```\n\nIn 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](https://github.com/tornadoweb/tornado/blob/b6998247702a960f0c73004a6b5f8ae775607c03/tornado/platform/auto.pyi), a stub file imports and reexports definitions from a python file. With `-s`, python imports are silently ignored.\n\nMy 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.\n\n(Versions tested: tornadoweb/tornado@b69982477, python/mypy@ac193cf9dd, python/typeshed@68306484a)\n","author":{"url":"https://github.com/bdarnell","@type":"Person","name":"bdarnell"},"datePublished":"2016-04-12T01:25:12Z","url":"https://github.com/python/mypy/issues/1364"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4e47e8e5-b718-6c9b-c382-f42fd60e669f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A3D4:18020:AF810B:E999DB:6B0048C4 |
| html-safe-nonce | 5472b4700c2f6428e0162f55f293929d929fc67e96ceafda0d1e55ba4cecfe6a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0Q0OjE4MDIwOkFGODEwQjpFOTk5REI6NkIwMDQ4QzQiLCJ2aXNpdG9yX2lkIjoiMjk5OTIxMzUxOTQxMDQ4NTE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0c5457fa9c8786e7e1500f2568154744e5c55e5a53c61a16030ffbf91287532b |
| hovercard-subject-tag | issue:147604093 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/1364/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3f2833821022c4f920ce7eb858e320324333531ed5c472434594621772e4cf9b/python/mypy/issues/1364 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3f2833821022c4f920ce7eb858e320324333531ed5c472434594621772e4cf9b/python/mypy/issues/1364 |
| og:image:alt | $ 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 Torn... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bdarnell |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width