Title: Module re-exports in stub files not handled correctly · Issue #3681 · python/mypy · GitHub
Open Graph Title: Module re-exports in stub files not handled correctly · Issue #3681 · python/mypy
X Title: Module re-exports in stub files not handled correctly · Issue #3681 · python/mypy
Description: Mypy currently handles module re-exports in stub files the same way it handles them with regular Python files. That is, any symbol imported at the global level is available for re-export. However, PEP 484 contains the following lines in ...
Open Graph Description: Mypy currently handles module re-exports in stub files the same way it handles them with regular Python files. That is, any symbol imported at the global level is available for re-export. However, ...
X Description: Mypy currently handles module re-exports in stub files the same way it handles them with regular Python files. That is, any symbol imported at the global level is available for re-export. However, ...
Opengraph URL: https://github.com/python/mypy/issues/3681
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Module re-exports in stub files not handled correctly","articleBody":"Mypy currently handles module re-exports in stub files the same way it handles them with regular Python files. That is, any symbol imported at the global level is available for re-export. However, PEP 484 contains the following lines in the [section on stub files](https://www.python.org/dev/peps/pep-0484/#stub-files):\r\n\r\n> - Modules and variables imported into the stub are not considered exported from the stub unless the import uses the `import ... as ...` form or the equivalent `from ... import ... as ...` form.\r\n> - However, as an exception to the previous bullet, all objects imported into a stub using `from ... import *` are considered exported. (This makes it easier to re-export all objects from a given module that may vary by Python version.)\r\n\r\nI suspect this may be a bit tricky to implement cleanly because iirc, mypy currently doesn't have a mechanism that lets symbols be defined inside a module while being hidden outside (in part because Python itself doesn't really have such a mechanism). Also, my \"this might do weird things with incremental mode\" senses are tingling.\r\n\r\nFor context, this issue came up in this pull request: https://github.com/python/typeshed/pull/1471","author":{"url":"https://github.com/Michael0x2a","@type":"Person","name":"Michael0x2a"},"datePublished":"2017-07-08T18:55:32Z","url":"https://github.com/python/mypy/issues/3681"}
| 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:f415ed7c-43cc-954f-7044-e5e6cdc26f4b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 962C:106F5D:BC4F7F:FC5627:6B004E1E |
| html-safe-nonce | c7249b5ee1aa6156165156a75f447e12f6fa7481b946b6de466a20d8a1a9c516 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjJDOjEwNkY1RDpCQzRGN0Y6RkM1NjI3OjZCMDA0RTFFIiwidmlzaXRvcl9pZCI6IjczNjE5OTI2ODkyNzA2NzI5MjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6f6aefd2ed761ce13a3bdfae5a76fd56a221d6935deee4053a0206657f03e167 |
| hovercard-subject-tag | issue:241472932 |
| 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/3681/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cec2e0edd6a7bc04869a994302e0aea70972a4b4ed9331f6c0ed328582780ddc/python/mypy/issues/3681 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cec2e0edd6a7bc04869a994302e0aea70972a4b4ed9331f6c0ed328582780ddc/python/mypy/issues/3681 |
| og:image:alt | Mypy currently handles module re-exports in stub files the same way it handles them with regular Python files. That is, any symbol imported at the global level is available for re-export. However, ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Michael0x2a |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| 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 | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width