Title: Obvious errors with coroutines are not detected · Issue #10841 · python/mypy · GitHub
Open Graph Title: Obvious errors with coroutines are not detected · Issue #10841 · python/mypy
X Title: Obvious errors with coroutines are not detected · Issue #10841 · python/mypy
Description: Bug Report Some obvious type issues with coroutines are not detected. See two examples below. To Reproduce import asyncio async def function_one(): return 1 async def function_two(): function_one()[1] function_one() + 1 asyncio.run(funct...
Open Graph Description: Bug Report Some obvious type issues with coroutines are not detected. See two examples below. To Reproduce import asyncio async def function_one(): return 1 async def function_two(): function_one()...
X Description: Bug Report Some obvious type issues with coroutines are not detected. See two examples below. To Reproduce import asyncio async def function_one(): return 1 async def function_two(): function_one()...
Opengraph URL: https://github.com/python/mypy/issues/10841
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Obvious errors with coroutines are not detected","articleBody":"**Bug Report**\r\n\r\nSome obvious type issues with `coroutines` are not detected. See two examples below.\r\n\r\n**To Reproduce**\r\n\r\n```python\r\nimport asyncio\r\n\r\n\r\nasync def function_one():\r\n return 1\r\n\r\n\r\nasync def function_two():\r\n function_one()[1]\r\n function_one() + 1\r\n\r\n\r\nasyncio.run(function_two())\r\n```\r\n\r\n**Expected Behavior**\r\n\r\n`mypy` should detect two `TypeError` here:\r\n\r\n- `'coroutine' object is not subscriptable`\r\n- `unsupported operand type(s) for +: 'coroutine' and 'int'`\r\n\r\n**Actual Behavior**\r\n\r\n`Success: no issues found in 1 source file`\r\n\r\n**Your Environment**\r\n\r\nmypy 0.910\r\nPython 3.9.6\r\n","author":{"url":"https://github.com/WhyNotHugo","@type":"Person","name":"WhyNotHugo"},"datePublished":"2021-07-20T08:57:10Z","url":"https://github.com/python/mypy/issues/10841"}
| 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:d9483bfb-17bf-6b31-88b0-cb4cf21ac0ad |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D36:23D776:10028BA:15202EC:6B000A62 |
| html-safe-nonce | 2a68aaff691df8e1b41e1275487361220cf68fe518cc00e9a15aa2b0413c070e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDM2OjIzRDc3NjoxMDAyOEJBOjE1MjAyRUM6NkIwMDBBNjIiLCJ2aXNpdG9yX2lkIjoiMjQ5NzIxMzkxNjA2MTM3MDk3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 58463e26b46d6675f1e823e3a9a3db755a812f2ce8dbc23586c77f6457a3477a |
| hovercard-subject-tag | issue:948445089 |
| 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/10841/issue_layout |
| twitter:image | https://opengraph.githubassets.com/93b8fe1a1fcc1812050b79051c00ec7a1b7eab323ee318ad5b02e65d5bd336ea/python/mypy/issues/10841 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/93b8fe1a1fcc1812050b79051c00ec7a1b7eab323ee318ad5b02e65d5bd336ea/python/mypy/issues/10841 |
| og:image:alt | Bug Report Some obvious type issues with coroutines are not detected. See two examples below. To Reproduce import asyncio async def function_one(): return 1 async def function_two(): function_one()... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | WhyNotHugo |
| 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