Title: Do not export imported names in stubs unless using 'as' · Issue #453 · python/mypy · GitHub
Open Graph Title: Do not export imported names in stubs unless using 'as' · Issue #453 · python/mypy
X Title: Do not export imported names in stubs unless using 'as' · Issue #453 · python/mypy
Description: If a stub for module x imports something from typing, for example, currently from x import * also imports that name, which is wrong, since generally the module implementation does not import anything from typing, and besides it's just a ...
Open Graph Description: If a stub for module x imports something from typing, for example, currently from x import * also imports that name, which is wrong, since generally the module implementation does not import anythi...
X Description: If a stub for module x imports something from typing, for example, currently from x import * also imports that name, which is wrong, since generally the module implementation does not import anythi...
Opengraph URL: https://github.com/python/mypy/issues/453
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Do not export imported names in stubs unless using 'as'","articleBody":"If a stub for module `x` imports something from `typing`, for example, currently `from x import *` also imports that name, which is wrong, since generally the module implementation does not import anything from `typing`, and besides it's just a bad idea in general.\n\nHowever, we don't want to define `__all__` for every stub, as that would be painful and redundant, since stubs mostly contain only exported features. Maybe we should not export any imported names by default, unless the import uses `as`. For example:\n\n``` python\nfrom typing import List # Not exported\nimport os.path as path # Exported\nimport os as os # Also exported\n```\n\nThis would only affect stubs. We need a way of knowing which files are stubs. Initially, just anything that is under `stubs/` should be considered a stub.\n","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2014-09-14T03:35:37Z","url":"https://github.com/python/mypy/issues/453"}
| 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:a05afb16-9061-347d-d88f-a82683178645 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D32:2828AA:26A95:360FC:6B007D9D |
| html-safe-nonce | 413621c74669bac87b3136a3669424c211776c35c6a7334d41eb0f4bae3ff61a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDMyOjI4MjhBQToyNkE5NTozNjBGQzo2QjAwN0Q5RCIsInZpc2l0b3JfaWQiOiI2ODUxNjUyNDczMTU3ODc3MTUwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 953a6533753f69d976c01cbaf37ccd2caf4d4e2edf9342845bc253a50c29f69f |
| hovercard-subject-tag | issue:42711751 |
| 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/453/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c1b2679006e4dd2e5ca3b9ecba1b699c8d5a8c90740e407c8a47af1ef7b76df/python/mypy/issues/453 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c1b2679006e4dd2e5ca3b9ecba1b699c8d5a8c90740e407c8a47af1ef7b76df/python/mypy/issues/453 |
| og:image:alt | If a stub for module x imports something from typing, for example, currently from x import * also imports that name, which is wrong, since generally the module implementation does not import anythi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| hostname | github.com |
| expected-hostname | github.com |
| None | 82c186f13e104004ab7bdb779f3195e59dd38bfde531aaa74b76470fc2462b83 |
| 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 | d1bc2aa1939001689f5ce935982c10a6138f745c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width