Title: Do not allow returns with arguments in generators · Issue #20 · python/mypy · GitHub
Open Graph Title: Do not allow returns with arguments in generators · Issue #20 · python/mypy
X Title: Do not allow returns with arguments in generators · Issue #20 · python/mypy
Description: The following is accepted by the compiler, even though it is not valid in Python: def f(): yield 1 return 1 There should be a compile error if mixing return with an argument and yield within the same function. Update: only disallow this ...
Open Graph Description: The following is accepted by the compiler, even though it is not valid in Python: def f(): yield 1 return 1 There should be a compile error if mixing return with an argument and yield within the sa...
X Description: The following is accepted by the compiler, even though it is not valid in Python: def f(): yield 1 return 1 There should be a compile error if mixing return with an argument and yield within the sa...
Opengraph URL: https://github.com/python/mypy/issues/20
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Do not allow returns with arguments in generators","articleBody":"The following is accepted by the compiler, even though it is not valid in Python:\n\n```\ndef f():\n yield 1\n return 1\n```\n\nThere should be a compile error if mixing return with an argument and yield within the same function.\n\n**Update: only disallow this in Python 2 (see below).**\n","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2012-12-13T12:27:02Z","url":"https://github.com/python/mypy/issues/20"}
| 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:d804fa5f-ae8e-c769-ad83-457fdea63d37 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C44:18DBD0:7ABE95:A90F67:6B009D96 |
| html-safe-nonce | b748ec8c1c1da18914cd747e5bc21e33ee3dca00ed7df7a3439075df95bfebbf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzQ0OjE4REJEMDo3QUJFOTU6QTkwRjY3OjZCMDA5RDk2IiwidmlzaXRvcl9pZCI6IjY3NzEwMzI3MjQzNzY0Mjc5MjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 47c09d2654bb3d41c29dd37941b0d382d8fff44798d96ff1c34fd393d56edd78 |
| hovercard-subject-tag | issue:9250405 |
| 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/20/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7f13afed860c4ddd39308b55079f09ce69f75e67c7d1d84c3b9f4b60c9537fb9/python/mypy/issues/20 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7f13afed860c4ddd39308b55079f09ce69f75e67c7d1d84c3b9f4b60c9537fb9/python/mypy/issues/20 |
| og:image:alt | The following is accepted by the compiler, even though it is not valid in Python: def f(): yield 1 return 1 There should be a compile error if mixing return with an argument and yield within the sa... |
| 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 | 52c95ce7e48016ae14399656b4ee812462b6f1fa28c5008c8394da64794c00b8 |
| 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 | 1c9ddec8215f9a94e295c8310c3579b9c54ba31a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width