Title: Unpacking tuples of variable length · Issue #1178 · python/mypy · GitHub
Open Graph Title: Unpacking tuples of variable length · Issue #1178 · python/mypy
X Title: Unpacking tuples of variable length · Issue #1178 · python/mypy
Description: Given the following code: from typing import Any, Dict, Tuple, Union VarTuple = Union[Tuple[int, int], Tuple[int, int, int]] def make_tuple(): # type: () -> VarTuple return None x = make_tuple() a = b = c = 0 if len(x) == 3: a, b, c = x ...
Open Graph Description: Given the following code: from typing import Any, Dict, Tuple, Union VarTuple = Union[Tuple[int, int], Tuple[int, int, int]] def make_tuple(): # type: () -> VarTuple return None x = make_tuple() a ...
X Description: Given the following code: from typing import Any, Dict, Tuple, Union VarTuple = Union[Tuple[int, int], Tuple[int, int, int]] def make_tuple(): # type: () -> VarTuple return None x = make_tuple()...
Opengraph URL: https://github.com/python/mypy/issues/1178
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unpacking tuples of variable length","articleBody":"Given the following code:\n\n```\nfrom typing import Any, Dict, Tuple, Union\n\nVarTuple = Union[Tuple[int, int], Tuple[int, int, int]]\n\ndef make_tuple():\n # type: () -> VarTuple\n return None\n\nx = make_tuple()\na = b = c = 0\nif len(x) == 3:\n a, b, c = x\nelse:\n a, b = x\n c = 0\n```\n\nmypy complains about the following error:\n\n```\nsandbox.py:12: error: 'Union[Tuple[builtins.int, builtins.int], Tuple[builtins.int, builtins.int, builtins.int]]' object is not iterable\nsandbox.py:14: error: 'Union[Tuple[builtins.int, builtins.int], Tuple[builtins.int, builtins.int, builtins.int]]' object is not iterable\n```\n","author":{"url":"https://github.com/mihneagiurgea","@type":"Person","name":"mihneagiurgea"},"datePublished":"2016-01-28T00:09:25Z","url":"https://github.com/python/mypy/issues/1178"}
| 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:3a561e77-d638-47df-57a4-4862e3ae0be2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DB2:144E47:260D98B:319AA8B:6AFFF7FF |
| html-safe-nonce | a01c59ca36d85c069fb78765bf571c39feb664171c59fe5bbab9f41d42d0e8cf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REIyOjE0NEU0NzoyNjBEOThCOjMxOUFBOEI6NkFGRkY3RkYiLCJ2aXNpdG9yX2lkIjoiNjczNzcyNjcwNDY5NDg1MTU4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 80c41d2dbe2a388c4f4dcd823a84acd81a094ace025568f49d7e782bfe8a1af4 |
| hovercard-subject-tag | issue:129308661 |
| 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/1178/issue_layout |
| twitter:image | https://opengraph.githubassets.com/159e31a3bf3310266a162b16784654299e7c48cb30679e6973e3663f13d1acad/python/mypy/issues/1178 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/159e31a3bf3310266a162b16784654299e7c48cb30679e6973e3663f13d1acad/python/mypy/issues/1178 |
| og:image:alt | Given the following code: from typing import Any, Dict, Tuple, Union VarTuple = Union[Tuple[int, int], Tuple[int, int, int]] def make_tuple(): # type: () -> VarTuple return None x = make_tuple() a ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mihneagiurgea |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width