Title: no error when using `TypeGuard` outside of return type · Issue #11765 · python/mypy · GitHub
Open Graph Title: no error when using `TypeGuard` outside of return type · Issue #11765 · python/mypy
X Title: no error when using `TypeGuard` outside of return type · Issue #11765 · python/mypy
Description: from typing import TypeGuard def foo(value: TypeGuard[int]) -> None: ... # no error bar: TypeGuard[int] = True # no error https://mypy-play.net/?mypy=master&python=3.10&flags=show-error-codes,allow-redefinition,strict,check-untyped...
Open Graph Description: from typing import TypeGuard def foo(value: TypeGuard[int]) -> None: ... # no error bar: TypeGuard[int] = True # no error https://mypy-play.net/?mypy=master&python=3.10&flags=show-error-codes,all...
X Description: from typing import TypeGuard def foo(value: TypeGuard[int]) -> None: ... # no error bar: TypeGuard[int] = True # no error https://mypy-play.net/?mypy=master&python=3.10&flags=show-error-...
Opengraph URL: https://github.com/python/mypy/issues/11765
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"no error when using `TypeGuard` outside of return type","articleBody":"```py\r\nfrom typing import TypeGuard\r\n\r\ndef foo(value: TypeGuard[int]) -> None: ... # no error\r\n\r\nbar: TypeGuard[int] = True # no error\r\n```\r\nhttps://mypy-play.net/?mypy=master&python=3.10&flags=show-error-codes%2Callow-redefinition%2Cstrict%2Ccheck-untyped-defs%2Cdisallow-any-decorated%2Cdisallow-any-expr%2Cdisallow-any-explicit%2Cdisallow-any-generics%2Cdisallow-any-unimported%2Cdisallow-incomplete-defs%2Cdisallow-subclassing-any%2Cdisallow-untyped-calls%2Cdisallow-untyped-decorators%2Cdisallow-untyped-defs%2Cno-implicit-optional%2Cno-implicit-reexport%2Cstrict-equality%2Cwarn-incomplete-stub%2Cwarn-redundant-casts%2Cwarn-return-any%2Cwarn-unreachable%2Cwarn-unused-configs%2Cwarn-unused-ignores&gist=5688d5a175acf9e249be851648be999e","author":{"url":"https://github.com/DetachHead","@type":"Person","name":"DetachHead"},"datePublished":"2021-12-16T07:25:15Z","url":"https://github.com/python/mypy/issues/11765"}
| 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:071bec0a-bd00-c9c2-81ad-db12e1449151 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B3EA:1CEB9:62640:8813D:6B004EB1 |
| html-safe-nonce | 474c0a60fa236aa9f6b085d4e8ac8bea7d446832f331c004628c60ac071527ef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0VBOjFDRUI5OjYyNjQwOjg4MTNEOjZCMDA0RUIxIiwidmlzaXRvcl9pZCI6IjkwMjAwOTE1NjE5MjQ1NjM2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 49efab9666f04e498c610e4aadb8471eadb6394f0d8b3ff8909c91ae7116fc5a |
| hovercard-subject-tag | issue:1081857214 |
| 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/11765/issue_layout |
| twitter:image | https://opengraph.githubassets.com/635623d584a13d5e4f7cde2e4414ebf4cbfc8dc9106a08012311977a50d12509/python/mypy/issues/11765 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/635623d584a13d5e4f7cde2e4414ebf4cbfc8dc9106a08012311977a50d12509/python/mypy/issues/11765 |
| og:image:alt | from typing import TypeGuard def foo(value: TypeGuard[int]) -> None: ... # no error bar: TypeGuard[int] = True # no error https://mypy-play.net/?mypy=master&python=3.10&flags=show-error-codes,all... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DetachHead |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| 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 | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width