Title: Type hinting example from 3.9.0 docs don't work (v0.79) · Issue #9740 · python/mypy · GitHub
Open Graph Title: Type hinting example from 3.9.0 docs don't work (v0.79) · Issue #9740 · python/mypy
X Title: Type hinting example from 3.9.0 docs don't work (v0.79) · Issue #9740 · python/mypy
Description: The following example from the 3.9.0 type hinting docs: Vector = list[float] makes mypy complain that: "list" is not subscriptable, use "typing.List" instead This differs from 3.8 docs in that they actually use typing.List instead. Is th...
Open Graph Description: The following example from the 3.9.0 type hinting docs: Vector = list[float] makes mypy complain that: "list" is not subscriptable, use "typing.List" instead This differs from 3.8 docs in that they...
X Description: The following example from the 3.9.0 type hinting docs: Vector = list[float] makes mypy complain that: "list" is not subscriptable, use "typing.List" instead This differs from 3...
Opengraph URL: https://github.com/python/mypy/issues/9740
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Type hinting example from 3.9.0 docs don't work (v0.79)","articleBody":"The following example from the 3.9.0 type hinting docs:\r\n`Vector = list[float]`\r\nmakes mypy complain that:\r\n`\"list\" is not subscriptable, use \"typing.List\" instead`\r\n\r\nThis differs from 3.8 docs in that they actually use typing.List instead. Is this a doc issue or a mypy issue?\r\n\r\nI am aware that I can use typing.List for this case, but if there's an option to not include a module, I would rather take that option.\r\n\r\n**To Reproduce**\r\n\r\n1. Create a Python file with the content above\r\n2. Run through mypy\r\n3. Observe that it complains about how **\"list is not subscriptable\"** and that I should use typing.List instead\r\n\r\n**Expected Behavior**\r\n\r\nI expect it to not complain.\r\n\r\n**Actual Behavior**\r\n\r\nIt complains.\r\n\r\n**Your Environment**\r\n\r\nVSCode with mypy as linter.\r\n\r\n- Mypy version used: 0.79\r\n- Python version used: 3.9\r\n- Operating system and version: Win10\r\n","author":{"url":"https://github.com/tekinozbek","@type":"Person","name":"tekinozbek"},"datePublished":"2020-11-21T04:37:15Z","url":"https://github.com/python/mypy/issues/9740"}
| 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:8ca389fb-64c4-186d-bf38-46d4882fd2d2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E124:2BB4ED:157C0C:1D94F5:6B008262 |
| html-safe-nonce | 620f13974ba8d1e2cd45a5e01321ae0da9c1f8296b2d892179a62b8a1ed2e7c5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTI0OjJCQjRFRDoxNTdDMEM6MUQ5NEY1OjZCMDA4MjYyIiwidmlzaXRvcl9pZCI6IjU3MDYzMjE1ODg4MDczMDM3NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 380f013acc1007f074dc707d8963a1470edd40d889923b0f715a1e3b277edb46 |
| hovercard-subject-tag | issue:747924076 |
| 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/9740/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ee770581486c106fb236f675edacda16af993f4fe8c037cd343e481d73056db2/python/mypy/issues/9740 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ee770581486c106fb236f675edacda16af993f4fe8c037cd343e481d73056db2/python/mypy/issues/9740 |
| og:image:alt | The following example from the 3.9.0 type hinting docs: Vector = list[float] makes mypy complain that: "list" is not subscriptable, use "typing.List" instead This differs from 3.8 docs in that they... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tekinozbek |
| 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