Title: An Intersection type? · Issue #18 · python/typing · GitHub
Open Graph Title: An Intersection type? · Issue #18 · python/typing
X Title: An Intersection type? · Issue #18 · python/typing
Description: Sometimes you want to say that an argument must follow two or more different protocols. For example, you might want to state that an argument must be an Iterable and a Container (for example, it could be a Set, a Mapping or a Sequence). ...
Open Graph Description: Sometimes you want to say that an argument must follow two or more different protocols. For example, you might want to state that an argument must be an Iterable and a Container (for example, it co...
X Description: Sometimes you want to say that an argument must follow two or more different protocols. For example, you might want to state that an argument must be an Iterable and a Container (for example, it co...
Opengraph URL: https://github.com/python/typing/issues/18
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"An Intersection type?","articleBody":"Sometimes you want to say that an argument must follow two or more different protocols. For example, you might want to state that an argument must be an Iterable and a Container (for example, it could be a Set, a Mapping or a Sequence). It would be nice if this could be spelled like this:\n\n```\ndef assertIn(item: T, thing: Intersection[Iterable[T], Container[T]]) -\u003e None:\n if item not in thing:\n # Debug output\n for it in thing:\n print(it)\n```\n","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2014-10-16T20:53:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/18/typing/issues/18"}
| 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:7aeacd6e-7459-321f-856e-016a442198da |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 87EE:57C20:897D04:B6F008:69697B8C |
| html-safe-nonce | 089c5a033b6e7305cba5e43fec403e16a83a23450ae1428d65c719ad35073eef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0VFOjU3QzIwOjg5N0QwNDpCNkYwMDg6Njk2OTdCOEMiLCJ2aXNpdG9yX2lkIjoiMzU3OTU5OTY3OTU0NTUwNjcwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 73af06f81b32a80c8eb165996966fd99f29380b33be2d57d2a230e2a81a7e742 |
| hovercard-subject-tag | issue:46034432 |
| 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/typing/18/issue_layout |
| twitter:image | https://opengraph.githubassets.com/34533888b22595274f210a930a45833d00380416b7b4571e8a40ebfa0dfa4bb8/python/typing/issues/18 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/34533888b22595274f210a930a45833d00380416b7b4571e8a40ebfa0dfa4bb8/python/typing/issues/18 |
| og:image:alt | Sometimes you want to say that an argument must follow two or more different protocols. For example, you might want to state that an argument must be an Iterable and a Container (for example, it co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gvanrossum |
| hostname | github.com |
| expected-hostname | github.com |
| None | f33e4b94c8824ab2b434d82a94139432fb5ebee9df4b75304140ad22508c4a77 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typing git https://github.com/python/typing.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 24604008 |
| octolytics-dimension-repository_nwo | python/typing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24604008 |
| octolytics-dimension-repository_network_root_nwo | python/typing |
| 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 | 48f380098b30acbb700b04f1724481ca10d574fc |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width