Title: mypy cannot parse type comment of "with" and "for" statement in PEP 484 · Issue #892 · python/mypy · GitHub
Open Graph Title: mypy cannot parse type comment of "with" and "for" statement in PEP 484 · Issue #892 · python/mypy
X Title: mypy cannot parse type comment of "with" and "for" statement in PEP 484 · Issue #892 · python/mypy
Description: https://www.python.org/dev/peps/pep-0484/#type-comments I tried to check type comments, but it cannot parse "with" and "for" statement as below. # Example 1 x = [] # type: List[Employee] x, y, z = [], [], [] # type: List[int], List[int],...
Open Graph Description: https://www.python.org/dev/peps/pep-0484/#type-comments I tried to check type comments, but it cannot parse "with" and "for" statement as below. # Example 1 x = [] # type: List[Employee] x, y, z = ...
X Description: https://www.python.org/dev/peps/pep-0484/#type-comments I tried to check type comments, but it cannot parse "with" and "for" statement as below. # Example 1 x = [] # type: List[...
Opengraph URL: https://github.com/python/mypy/issues/892
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mypy cannot parse type comment of \"with\" and \"for\" statement in PEP 484","articleBody":"- https://www.python.org/dev/peps/pep-0484/#type-comments\n\nI tried to check type comments, but it cannot parse \"with\" and \"for\" statement as below.\n\n``` python\n# Example 1\nx = [] # type: List[Employee]\nx, y, z = [], [], [] # type: List[int], List[int], List[str]\nx, y, z = [], [], [] # type: (List[int], List[int], List[str])\nx = [\n 1,\n 2,\n] # type: List[int]\n\n# Example 2\nfrom contextlib import contextmanager\n\n@contextmanager\ndef frobnicate():\n yield 1\n\nwith frobnicate() as foo: # type: int\n # Here foo is an int\n ...\n\n# Example 3\npoints = [(1.0, 2.5)] # type: List[Tuple[float, float]]\nfor x, y in points: # type: float, float\n # Here x and y are floats\n ...\n```\n\n``` bash\n$ mypy type_comments.py \ntype_comments.py:17: error: Parse error before \"int\"\ntype_comments.py:23: error: Parse error before \"float\"\n```\n","author":{"url":"https://github.com/t2y","@type":"Person","name":"t2y"},"datePublished":"2015-10-04T12:03:02Z","url":"https://github.com/python/mypy/issues/892"}
| 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:ddd34bce-4ded-5e8d-2abe-dd4ec5b07257 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B20A:3D44CB:D8DDBA:11C4281:6AFFFB0C |
| html-safe-nonce | f95f10fdcef056f66a10363fbd8481441fee915f8896a54b9362a9801661ca36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjBBOjNENDRDQjpEOEREQkE6MTFDNDI4MTo2QUZGRkIwQyIsInZpc2l0b3JfaWQiOiI0MzUxNzY1OTU1MzYyMTU5MzcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f1391d8a2657a55a63b5c8926a651d71655b08791e37b2cbfac1c0e695b804f9 |
| hovercard-subject-tag | issue:109676975 |
| 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/892/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eea6dac64e3e78abcbd7f7f922751b7d83f14d3e08ac3c38f0eba44432344577/python/mypy/issues/892 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eea6dac64e3e78abcbd7f7f922751b7d83f14d3e08ac3c38f0eba44432344577/python/mypy/issues/892 |
| og:image:alt | https://www.python.org/dev/peps/pep-0484/#type-comments I tried to check type comments, but it cannot parse "with" and "for" statement as below. # Example 1 x = [] # type: List[Employee] x, y, z = ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | t2y |
| 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