Title: Support isinstance with a tuple of types · Issue #947 · python/mypy · GitHub
Open Graph Title: Support isinstance with a tuple of types · Issue #947 · python/mypy
X Title: Support isinstance with a tuple of types · Issue #947 · python/mypy
Description: If the second argument to isinstance is a tuple, the inferred type for the first argument should be a union. Example: x = 1 # type: object if isinstance(x, (int, str)): # type of x is Union[int, str] here ...
Open Graph Description: If the second argument to isinstance is a tuple, the inferred type for the first argument should be a union. Example: x = 1 # type: object if isinstance(x, (int, str)): # type of x is Union[int, st...
X Description: If the second argument to isinstance is a tuple, the inferred type for the first argument should be a union. Example: x = 1 # type: object if isinstance(x, (int, str)): # type of x is Union[int, st...
Opengraph URL: https://github.com/python/mypy/issues/947
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support isinstance with a tuple of types","articleBody":"If the second argument to `isinstance` is a tuple, the inferred type for the first argument should be a union.\n\nExample:\n\n``` python\nx = 1 # type: object\nif isinstance(x, (int, str)):\n # type of x is Union[int, str] here \n ...\n```\n","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2015-10-17T18:56:42Z","url":"https://github.com/python/mypy/issues/947"}
| 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:6c28faa5-2d87-cebf-5c68-6e09b7d1c493 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8ED0:3204C8:36B5B08:48AC84D:6B0049D2 |
| html-safe-nonce | 6b15e850ce4811fbd744aaa7d6254211fe3bdbe7a6eea5b72c14a10863b9ab6d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUQwOjMyMDRDODozNkI1QjA4OjQ4QUM4NEQ6NkIwMDQ5RDIiLCJ2aXNpdG9yX2lkIjoiNzc0NDIzNDk0MzEzOTU2Mzk4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a3417240cba8e4f4b34c3e44f74588b9ec9c0c1ea5299ffcf33fd8d648cddbc6 |
| hovercard-subject-tag | issue:111979105 |
| 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/947/issue_layout |
| twitter:image | https://opengraph.githubassets.com/25d37239411eb1697aeceae4add5ddf592606b44eabdef26108ba0742ea58a04/python/mypy/issues/947 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/25d37239411eb1697aeceae4add5ddf592606b44eabdef26108ba0742ea58a04/python/mypy/issues/947 |
| og:image:alt | If the second argument to isinstance is a tuple, the inferred type for the first argument should be a union. Example: x = 1 # type: object if isinstance(x, (int, str)): # type of x is Union[int, st... |
| 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 | 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