Title: Differentiate LvalueTuple from expression TupleExpr (refactoring) · Issue #2123 · python/mypy · GitHub
Open Graph Title: Differentiate LvalueTuple from expression TupleExpr (refactoring) · Issue #2123 · python/mypy
X Title: Differentiate LvalueTuple from expression TupleExpr (refactoring) · Issue #2123 · python/mypy
Description: (Apologies in advance if I am explaining the obvious) In the expression (a, b) = (b, a) The left side is an lvalue and the right side is not. The two concepts have only so much in common. If a TupleExpr makes its way where an LvalueTuple...
Open Graph Description: (Apologies in advance if I am explaining the obvious) In the expression (a, b) = (b, a) The left side is an lvalue and the right side is not. The two concepts have only so much in common. If a Tupl...
X Description: (Apologies in advance if I am explaining the obvious) In the expression (a, b) = (b, a) The left side is an lvalue and the right side is not. The two concepts have only so much in common. If a Tupl...
Opengraph URL: https://github.com/python/mypy/issues/2123
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Differentiate LvalueTuple from expression TupleExpr (refactoring)","articleBody":"(Apologies in advance if I am explaining the obvious)\nIn the expression\n\n```\n(a, b) = (b, a)\n```\n\nThe left side is an lvalue and the right side is not. The two concepts have only so much in common. If a `TupleExpr` makes its way where an `LvalueTuple` belongs, that's a bug. It's also a bug in the other way around (unlike in some programming languages). This distinction appears in the AST as a Load/Store distinction, and it should be expressed in node.py too.\n\nThis distinction needs to be accompanied with the general distinction of lvalue nodes (i.e. a dedicated unifying type, instead of a comment) for targets in `for`, `with` etc.. However, I don't think that a dedicated `LvalueName` is helpful since it refers to the same entity as `NameExpr`. It is not the case with tuples; `LvalueTuple` is more of a pattern-matching construct than an expression.\n\nThe should _not_ be a distinction between `LvalueTuple` and `LvalueList`. since the language does not have this distinction (e.g. `[a, b] = (b, a)` is valid)\n\nI think that it will make the code clearer, better documented, better checked and with less `isinstance` tests and `cast`s sprinkled around; in some cases, I think that these tests will be replace by an `accept()` call.\n","author":{"url":"https://github.com/elazarg","@type":"Person","name":"elazarg"},"datePublished":"2016-09-12T10:27:51Z","url":"https://github.com/python/mypy/issues/2123"}
| 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:22bba306-471b-7205-4d8f-0e1c93372bc6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE48:B5253:237DFFE:2F2D7DC:6B005704 |
| html-safe-nonce | 5dd5954ad0775e704534102ebab6082f11afbbedded77ccbcf838f57a0c8eedb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTQ4OkI1MjUzOjIzN0RGRkU6MkYyRDdEQzo2QjAwNTcwNCIsInZpc2l0b3JfaWQiOiIxNjk4NDY0MTcyMTIxMDIwMTY0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5bd50a2f6a834574c070648aabeb2fb1c91aae6bd5e5a38f7b8bee9372c3f658 |
| hovercard-subject-tag | issue:176342624 |
| 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/2123/issue_layout |
| twitter:image | https://opengraph.githubassets.com/efa8aa8f434d94c3859400ed47097a4d707a97b63f89c46c31db1dfa7d97ddcd/python/mypy/issues/2123 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/efa8aa8f434d94c3859400ed47097a4d707a97b63f89c46c31db1dfa7d97ddcd/python/mypy/issues/2123 |
| og:image:alt | (Apologies in advance if I am explaining the obvious) In the expression (a, b) = (b, a) The left side is an lvalue and the right side is not. The two concepts have only so much in common. If a Tupl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | elazarg |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| 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 | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width