René's URL Explorer Experiment


Title: Map with bind: match Tuple of parameterized types with parameters from TypeVarTuple · Issue #1383 · python/typing · GitHub

Open Graph Title: Map with bind: match Tuple of parameterized types with parameters from TypeVarTuple · Issue #1383 · python/typing

X Title: Map with bind: match Tuple of parameterized types with parameters from TypeVarTuple · Issue #1383 · python/typing

Description: Prior work in PEP-646 on Map was dropped to simplify it, with a promise it would appear in a future PEP. Here is a reference to the dropped Map feature: #193 (comment) Here is an discussion of a potential usage of this Map feature for ma...

Open Graph Description: Prior work in PEP-646 on Map was dropped to simplify it, with a promise it would appear in a future PEP. Here is a reference to the dropped Map feature: #193 (comment) Here is an discussion of a po...

X Description: Prior work in PEP-646 on Map was dropped to simplify it, with a promise it would appear in a future PEP. Here is a reference to the dropped Map feature: #193 (comment) Here is an discussion of a po...

Opengraph URL: https://github.com/python/typing/issues/1383

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Map with bind: match Tuple of parameterized types with parameters from TypeVarTuple","articleBody":"Prior work in PEP-646 on Map was dropped to simplify it, with a promise it would appear in a future PEP. Here is a reference to the dropped Map feature:  https://github.com/python/typing/issues/193#issuecomment-782689251\r\n\r\nHere is an discussion of a potential usage of this Map feature for matching argument types for a length-n Tuple of unary Callables with a length-n Tuple parameterized by a TypeVarTuple: https://groups.google.com/g/dev-python/c/SbPOxIEvI60?pli=1\r\n\r\nHere is a draft spec of PEP-646 that included discussion of Map: https://github.com/python/peps/blob/bf897f8c839d1b4d4534ab1fa223a210e2cacf06/pep-0646.rst\r\n\r\nI would like to propose an extension of Map with a \"bind\" argument to allow disambiguation in case the parameterized type has multiple generic parameters. To give an example:\r\n\r\n```python\r\n###########\r\n## Converting from multiple domains to a common codomain\r\n############\r\n\r\nDomain = TypeVar('Domain')\r\nCodomain = TypeVar('Codomain')\r\n\r\nclass Detector(Generic(Domain)):\r\n    def __init__(self, detector_fn: Callable[[Any], Optional[Domain]):\r\n        self.detector_fn = detector_fn\r\n\r\n    def detect(arg: Any) -> Optional[Domain]\r\n         # returns `arg` if `arg` belongs to Domain, otherwise returns None\r\n        return self.detector_fn(arg)\r\n\r\nclass Converter(Generic[Domain, Codomain]):\r\n    def __init__(self, converter_fn: Callable[[Domain], Codomain]):\r\n        self.converter_fn = converter_fn\r\n\r\n    def convert(arg: Domain) -> Codomain:\r\n        return self.converter_fn(arg)\r\n\r\nDomains = TypeVarTuple('Domains')\r\n\r\nclass ConverterCollection(Generic[*Domains, Codomain]):\r\n    def __init__(self, detectors: Tuple[*Map[Detector, Domains]], converters: Tuple[*Map[Converter, Domains, bind=Domain]]):\r\n        self.detectors = detectors\r\n        self.converters = converters\r\n\r\n    def convert(self, obj_to_convert: Union[*Domains]) -> Codomain:\r\n        for detector, converter in zip(self.detectors, self.converters):\r\n            detected_object = detector.detect(obj_to_convert)\r\n            if not (detected_object is None):\r\n                return converter.convert(object_to_convert)\r\n        raise ValueError('No converter for object.')\r\n\r\n### Usage\r\n\r\nint_detector = Detector[int](lambda x: x if isinstance(x, int) else None)\r\nint_converter = Converter[int, str](lambda x: json.dumps(x))\r\n\r\nfloat_detector = Detector[float](lambda x: x if isinstance(x, float) else None)\r\nfloat_converter = Converter[float, str](lambda x: json.dumps(x))\r\n\r\ncc = ConverterCollection[int, float, str](\r\n    (int_detector, float_detector),\r\n    (int_converter, float_converter)\r\n)\r\n\r\ncc.convert(2)    # works\r\ncc.convert(2.0) # also works\r\ncc.convert('hi')  # type error\r\n\r\n```\r\n\r\nThe `bind=Domain` argument here would be because Converter class is generic in both Domain and Codomain, so there is ambiguity about which generic parameter to Map. This is not necessary for Detector because, because it is generic only over Domain, so there is no ambiguity what to map over.\r\n","author":{"url":"https://github.com/jmsmdy","@type":"Person","name":"jmsmdy"},"datePublished":"2023-04-03T03:18:31Z","url":"https://github.com/python/typing/issues/1383"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ec811ff3-bdd1-6e0b-1b15-ed24e4faa8c6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDEFA:12476C:1839644:1FD0BBB:6B0019DE
html-safe-noncee145b747227f505d2fb0319a08b1c2672140fdc5d966a682d7ed23df200ab913
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERUZBOjEyNDc2QzoxODM5NjQ0OjFGRDBCQkI6NkIwMDE5REUiLCJ2aXNpdG9yX2lkIjoiMzk2NjYzMTY1NTE5OTc0MjQzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0a0182bca1be3869baf82cb30cd8630be1ab14d8b396e47cddcbbd11c846317b
hovercard-subject-tagissue:1651262274
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typing/1383/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ff432a87526be25b7f2d5782e0e6be24015f7357a82e5a37a03f04fe719d5d21/python/typing/issues/1383
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ff432a87526be25b7f2d5782e0e6be24015f7357a82e5a37a03f04fe719d5d21/python/typing/issues/1383
og:image:altPrior work in PEP-646 on Map was dropped to simplify it, with a promise it would appear in a future PEP. Here is a reference to the dropped Map feature: #193 (comment) Here is an discussion of a po...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejmsmdy
hostnamegithub.com
expected-hostnamegithub.com
Nonea2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4
turbo-cache-controlno-preview
go-importgithub.com/python/typing git https://github.com/python/typing.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id24604008
octolytics-dimension-repository_nwopython/typing
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24604008
octolytics-dimension-repository_network_root_nwopython/typing
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release70121d4e855ee0bb7b75cf15d061d91f8863c0f8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typing/issues/1383#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F1383
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F1383
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Ftyping
Reloadhttps://github.com/python/typing/issues/1383
Reloadhttps://github.com/python/typing/issues/1383
Reloadhttps://github.com/python/typing/issues/1383
pythonhttps://github.com/python
typinghttps://github.com/python/typing
Codehttps://github.com/python/typing
Issues206 (206)https://github.com/python/typing/issues
Pull requests27 (27)https://github.com/python/typing/pulls
Discussionshttps://github.com/python/typing/discussions
Actionshttps://github.com/python/typing/actions
Security and qualityhttps://github.com/python/typing/security
Insightshttps://github.com/python/typing/insights
https://github.com/python/typing
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/1383
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/1383
Map with bind: match Tuple of parameterized types with parameters from TypeVarTuplehttps://github.com/python/typing/issues/1383#top
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
https://github.com/jmsmdy
jmsmdyhttps://github.com/jmsmdy
on Apr 3, 2023https://github.com/python/typing/issues/1383#issue-1651262274
PEP-646https://peps.python.org/646
#193 (comment)https://github.com/python/typing/issues/193#issuecomment-782689251
https://groups.google.com/g/dev-python/c/SbPOxIEvI60?pli=1https://groups.google.com/g/dev-python/c/SbPOxIEvI60?pli=1
PEP-646https://peps.python.org/646
https://github.com/python/peps/blob/bf897f8c839d1b4d4534ab1fa223a210e2cacf06/pep-0646.rsthttps://github.com/python/peps/blob/bf897f8c839d1b4d4534ab1fa223a210e2cacf06/pep-0646.rst
jmsmdyhttps://github.com/jmsmdy
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
on Apr 3, 2023https://github.com/python/typing/issues/1383#event-8908027484
https://github.com/erictraut
erictrauthttps://github.com/erictraut
on Apr 3, 2023https://github.com/python/typing/issues/1383#issuecomment-1494535972
PEP 637https://peps.python.org/pep-0637/
PEP 695https://peps.python.org/pep-0695/
https://github.com/jmsmdy
jmsmdyhttps://github.com/jmsmdy
on Apr 3, 2023https://github.com/python/typing/issues/1383#issuecomment-1494726144
PEP 637https://peps.python.org/pep-0637/
PEP-646https://peps.python.org/646
PEP-646https://peps.python.org/646
PEP-646https://peps.python.org/646
PEP 695https://peps.python.org/pep-0695/
https://github.com/erictraut
erictrauthttps://github.com/erictraut
on Apr 4, 2023https://github.com/python/typing/issues/1383#issuecomment-1496151535
full support for PEP 646https://github.com/python/mypy/issues/12280
https://github.com/mikeshardmind
mikeshardmindhttps://github.com/mikeshardmind
on Aug 28, 2023https://github.com/python/typing/issues/1383#issuecomment-1696317344
https://github.com/Be3y4uu-K0T
Be3y4uu-K0Thttps://github.com/Be3y4uu-K0T
on Sep 10, 2023https://github.com/python/typing/issues/1383#issuecomment-1712819083
https://github.com/insilications
insilicationshttps://github.com/insilications
on Oct 4, 2023https://github.com/python/typing/issues/1383#issuecomment-1746725296
https://github.com/HAOCHENYE
HAOCHENYEhttps://github.com/HAOCHENYE
on Dec 18, 2025https://github.com/python/typing/issues/1383#issuecomment-3668540861
flawedhttps://github.com/ray-project/ray/issues/59303
https://github.com/ray-project/ray/blob/631684a13067b15d95117ec097b6f3c6c1a44554/python/ray/actor.py#L93https://github.com/ray-project/ray/blob/631684a13067b15d95117ec097b6f3c6c1a44554/python/ray/actor.py#L93
https://github.com/MajorDallas
MajorDallashttps://github.com/MajorDallas
on Feb 20, 2026https://github.com/python/typing/issues/1383#issuecomment-3936093801
#1383 (comment)https://github.com/python/typing/issues/1383#issuecomment-1494726144
srittauhttps://github.com/srittau
on Feb 20, 2026https://github.com/python/typing/issues/1383#event-22955057892
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typing/issues/1383
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typing/issues/1383
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.